Macro to save drawing in automatic

Hello

I want to create a macro that allows me to save the drawing of my part

the goal: from the piece I create its layout, I arrange the views and at that time I would like to launch a Macro

which saves the drawing in the same directory as the part with the name of the "title" property of my part and then I count my drawing.

I've already sketched a macro that almost works,

I explain: when I have my drawing on the screen (not saved), I launch my macro, the file is created in the right directory with the right one, but the drawing I have on the screen is still not saved (I have a duplicate, one on solid not saved and one closed in my directory)

I appeal to your enlightenment, I am not an expert, far from it.

I hope I was clear enough

Thank you

Here's my macro


macro3.swp

Hello.

 

Well, in fact, you do a "save as" function with your saveas... Maybe you should try the save2 function instead?

 

IModelDoc2
Dim Silent As Boolean
Dim value As Integer
 
value = instance.Save2(Silent)

 

You seem to have your own soup and your own function, so I'll let you put it all in the right direction. 

 

swModel.Save2 "" & path & "" & "" & theRev & "" & ".slddrw", 0, True, False

1 Like