Macro to save X_T to SLDPRT.

I am looking for a way to use task scheduler to open up X_T files, and save them out as SLDPRT files in the same folder that the X_T file was opened in.

Has this been done before?

SolidworksApi macros
Answers 13
DG
DG 2014-02-04 Best Answer

I made a similar macro 4-5 years back. Not sure if I still have that but one thing is sure that it can be done

SF
SF 2014-02-04

I hope so!  Sure would be handy

SF
SF 2014-02-10

Deepak, did you have any luck finding that macro?

DG
DG 2014-02-11

Nopes but will make one for you tonight

SF
SF 2014-02-11

Thanks!

DG
DG 2014-02-11

Mike give this one a shot. Might need to tweak little bit.

Macro has been tested on SW2013 Sp 5.0, Win 7 x64

Please backup your files before using the macro.

SF
SF 2014-02-11

Thanks! Deepak, it works on my machine.  However, the files are being saved out as assemblies, not parts.  It is the same on yours?  I see in your notes that you wrote the macro is to save parasolids out as parts, not assemblies.

DG
DG 2014-02-12

I used the parasolid files to test the macro. Looks like yours are assembly ones. Let me fix the macro to take care of both part and assembly files and save them as part files only.

SF
SF 2014-02-14

Deepak,  I have realized that saving them out as sldprt files is not a good idea in my case.  In some instances they take twice as long to open, and make the assemblies that they are in run very, very slow.  The problem that I am having is that some of the parasolid files have the same part file names.  So, sometimes when opening numerous assemblies they open the wrong files.

Is there any way to modify the macro posted above to create a folder for each parasolid, same name as the parasolid file name, and then save each parasolid as an .sldasm in that unique folder?

DG
DG 2014-02-18

Hi Mike,

Sorry for a late reply. I've been messing with the macro and got the success on it. But somehow after first parasolid file loads, the macro changes the path to the sub folder created and hence it stops as there is no parasolid file in the sub folder. I'm trying to find out as why it is doing so.

BTW the above macro work irrespectively of the part or assembly file i.e. the macro will save the file the as part/assembly depending on the parasolid file (for e.g. if parasolid file is of part then it'll be saved as part and so on).

SF
SF 2014-02-18

Thanks again Deepak!  So the only thing that would need changing on the the macro from above is saving each parasolid in a unique folder.

DG
DG 2014-02-18

Yes and to some extent I've exceeded in doing that. But strangely macro is not playing good with me.

SF
SF 2014-03-20

Any luck Deepak?