API Question - ModelDoc2::SaveAs4 , how to prompt for path ?

I want to use the ModelDoc2::SaveAs4 command with my Save to DXF macro, but I am trying to figure out how to get the SaveAs dialog box to popup for the user to choose where to save the file. After reading the help file and examples, it looks like the default is the same directory as the SLDDRW.

Any help appreciated. Thanks.

Reply to
SW Monkey
Loading thread data ...

I want to use the ModelDoc2::SaveAs4 command with my Save to DXF macro, but I am trying to figure out how to get the SaveAs dialog box to popup for the user to choose where to save the file. After reading the help file and examples, it looks like the default is the same directory as the SLDDRW.

Any help appreciated. Thanks.

Reply to
SW Monkey

You could use InputBox to get started (to test the code). The drawback is that it would require the user to know the exact path and type it in correctly. I used this method in one of my SaveAs4 macros to save as PDF.

formatting link
in case you wish to check it out).

A form may be required, using the ListBox to show the folders available for save. I don't know if SolidWorks API is allowed to call Windows Save window (I seem to remember looking into this before), but you can definately create your own standard list (either built into the macro or in an external .ini file), or find a way to traverse the harddrive and list the results, so the user doesn't have to remember and type in the locaiton.

I'm only just OK at API, so I might be wrong about some of this.

Matt

SW M> I want to use the ModelDoc2::SaveAs4 command with my Save to DXF macro,

Reply to
fcsuper

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.