×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro for "new from" product

Macro for "new from" product

Macro for "new from" product

(OP)
I need a macro to create the function "New from", for principal product and for it's parts.
I found an way to do, but only for the principal product, all of it's parts remains the same, and I want to create new ones. The principal product and it's parts or products.

CODE --> CATvba

Sub CATMain()

Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim productDocument1 As ProductDocument
Set productDocument1 = documents1.NewFrom("C:\CATIA Library\STANDARDS\Springs\cilindro a gas\Cilindro a gas.CATProduct")

End Sub 

but in this way, only the Cilindro a gas.CATProduct has been performed the new from function. None of it's parts has been performed the new from.

So I want to pass from this:


to this:


After this, I want to rename all of its parts, and save in a new destination folder.

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

if CATIA API don't do the job, maybe you should look into managing this "New From" CATIA windows from win API

Eric N.
indocti discant et ament meminisse periti

RE: Macro for "new from" product

(OP)
But if I do it with windows, it will be very similar to make a copy from folder to folder. and when I open the CATProduct, all the parts of the product will open from the first file, because it's their address.

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

is it what is going on when you manually use the function?

Eric N.
indocti discant et ament meminisse periti

RE: Macro for "new from" product

(OP)
ok. I have developed something in the past, it works, but some times makes some bugs...Now I wanted to improve.

In a macro I opened the file with new from, and then make the save as to working folder, all of the parts were changed the part numbers and make the save as for each one. But don't now why, some times the original file was saved with the new generated parts...
I will need to think more how to do it.

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

Hello,

Here is something I've done.

https://www.youtube.com/watch?v=fnXOo9vOpC4

If you want it, I can send it by email. It is developed in .NET and it is difficult to share the code but not impossible.

Let me know.
Calin

RE: Macro for "new from" product

(OP)
Cilici, outstanding job.
If you can share it with me, I would appreciate very much. I still haven't figure out how to do it.

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

(OP)
Many thanks by your share.

There is an error:

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

What's your enviroment? OS, CATIA release? is it CATIA single installation, copied and registered or network deployment?

I've tested on a R19, network deployment and I got the same error. On a R21, single installation it worked fine.

The problem comes from SendToService object.

Please drop me a message on LinkedIn to send you the source code.

RE: Macro for "new from" product

One more for you: do you have PX1 license? It seems that this is your problem.

RE: Macro for "new from" product

Hi,

I noticed something else. Application is not "seeing" CATIA files from bigger releases then r21? Because for me is not showing in the beginning when you pick a file from a folder CATIA files from r25 but is showing me r21. Win 7 pro, r19,r21,25, v6r2013x - all local installation, 3DEx 2017 cloud (with rich app local).

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: Macro for "new from" product

Hello ferdo,

It has nothing to do with CATIA version, unless the extension of R25 files is not CATProduct/CATDrawing anymore :)

Or isn't it?

Calin

RE: Macro for "new from" product

(OP)
Cilici, what's a PX1 license?

My CATIA is a plm express version CAT+MCE+HCX

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

PX1 - CATIA - PPR PDM Gateway 1

@ferdo: is it included in PLM Express?

RE: Macro for "new from" product

Thank you Ferdo (very very low resolution) for taking your time.

As stated in the interface: the input files must be CATProduct and/or CATDrawing.

Is this asking your question?

Calin

RE: Macro for "new from" product

(OP)
So what can be the main cause for not working with me?

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

Calin, if you can do it, an option like this one would be useful.

Right now all the new parts get dumped in only one folder.

Thanks !

Best regards,
Costin Ruja

RE: Macro for "new from" product

(OP)
:( it's so unfair world....

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

Yes, sure, I suspect 'keep directory structure' is easy to implement. But that would be next week :)
I'll be back :)

Calin

RE: Macro for "new from" product

Is it possible to keep away from licenses? Seems to be pretty useful application but PX1...I'm not able to run this app. don't know if it's because of PX1 or system (Catia V5R26, Win10). Could you please share source code? I'm not able to contact you thru LinkedIn (Have to pay for some features like messaging).

RE: Macro for "new from" product

And back...
@Jenial: I have no idea why DS implemented this license check while creating the SendToService object. Interesting enough, using the SendToDirectory manually through V5 GUI does NOT prompt for PX1 license.
To summarize: automation of SendTo requires PX1. Feel free to contact your VAR and ask them: WHY!?

In the attachment is the newest version with the "Keep directory structure" option. Please note that if there is no common path, the option is not available.

Calin

RE: Macro for "new from" product

Many thanks !

Best regards,
Costin Ruja

RE: Macro for "new from" product

(OP)
Where do we find that option of send to?

Tiago Figueiredo
Tooling Engineer

RE: Macro for "new from" product

File -> Send To -> Directory

RE: Macro for "new from" product

(OP)
Many thanks, I never noticed that.

Tiago Figueiredo
Tooling Engineer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources