Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro for "new from" product 1

Status
Not open for further replies.

TiagoFigueiredo

Industrial
May 22, 2013
494
PT
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:
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:
1_st0ntd.png


to this:
2_pffodp.png


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


Tiago Figueiredo
Tooling Engineer
 
Replies continue below

Recommended for you

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 !

Capture_fzsoka.png


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

Calin
 
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).
 
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
 
 http://files.engineering.com/getfile.aspx?folder=f323f7b0-3c11-4897-9a8c-0329cd519419&file=SmartCopy.zip
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top