Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA macro send to

Status
Not open for further replies.

elmundo777

Automotive
Jun 23, 2020
93
Hello
I want to save a product and parts from tree. But SaveAs saves only a product. How can I save with macro all elements from tree?

I know about CreateSendTo(), but get an error. I'm read in forums, that needs PX1 license. But I'm have only hd2\md2.
This macro also don't work.

Code:
Sub CATMain()

Catia. DisplayFileAlerts = True

Path = CATIA. ActiveDocument.Path
Name = CATIA. ActiveDocument.Name

initial = Path & "A" & Name

Set Folder = CATIA. FileSystem.CreateFolder("oTemp")
oFolder = Path & "OTemp"

Set Send = CATIA. CreateSendTo()
Send.SetInitialFile (initial)     ' HERE I'm get an error
Send.SetDirectoryFile (oFolder)
Send.KeepDirectory(1)
Send.Run

End Sub
 
Replies continue below

Recommended for you

You start with the top product and move down to the bottom parts saving everything you see.

The problem is that "SaveAs" affects documents in current session, so you can't really go back to originals until you restart CATIA.
 
Little Cthulhu said:
Do you have a code or a part of code to demonstrate how i can save everything i see?
I'm really don't know how to do that.
 
Hi Elmundo777
Why don`t you just use Save Management?
With Save management you can save everything from the tree.
 
Hi Ferdo,

I guess there is a typo in your reply.
To use SendTo API we need either PX1 license or Smart Team Plugin to Catia.

Or it is better to workaround with the way Little Cthulhu suggessted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor