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.
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.
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
indocti discant et ament meminisse periti
RE: Macro for "new from" product
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
indocti discant et ament meminisse periti
RE: Macro for "new from" product
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
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
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
Here it is. It is a password protected zip (pass = 1234) to avoid being blocked
It has been barely tested on 2 different environments so if it doesn't work, please return here with the error code.
RE: Macro for "new from" product
There is an error:
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
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
RE: Macro for "new from" product
RE: Macro for "new from" product
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
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
My CATIA is a plm express version CAT+MCE+HCX
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
@ferdo: is it included in PLM Express?
RE: Macro for "new from" product
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Macro for "new from" product
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
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Macro for "new from" product
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Macro for "new from" product
Right now all the new parts get dumped in only one folder.
Thanks !
Best regards,
Costin Ruja
RE: Macro for "new from" product
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
I'll be back :)
Calin
RE: Macro for "new from" product
RE: Macro for "new from" product
@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
Best regards,
Costin Ruja
RE: Macro for "new from" product
Tiago Figueiredo
Tooling Engineer
RE: Macro for "new from" product
RE: Macro for "new from" product
Tiago Figueiredo
Tooling Engineer