Opening an assembly with a special configuration in "DOS" command

Hello.

I'm developing an application, and I'm looking for how to open a solidworks file (assembly) in a particular configuration using a "DOS" command or other.

If you have any idea, I'm all for it.

 

Thank you.

 

Hello

Just write the full name (path + file name + extension) to open it, e.g.:

C:\test.sldprt

If there are spaces in the folder names, do like this:

C:\"Program Files"\"ab cd"\"fichier solidworks avec espaces.sldprt"

Edit : si Solidworks n'est pas lancé, il faut peut-être lancé l'instruction une deuxième fois après une minute (le temps que SolidWorks se lance).

 

Hello.

 

I agree with you .PL for a simple opening of the file.

 

But if for example my file contains several configurations (example: A; B and C).

How do I force it to open the "C" configuration on the command line?

 

Thank you

1 Like

Indeed, sorry I had read the question too quickly!

I couldn't find any arguments to open a particular configuration, but I thought of two solutions:

- The file opens in the last configuration used, so save it with the configuration you want! (Not partial)

- Launch a macro with SolidWorks that will change the configuration like this:

"C:\Program Files\SolidWorks Corp\SolidWorks\SLDWORKS.exe" "/m" "chemin_de_la_macro.swp"

In this macro use opendoc6 where you can choose the configuration when opening the file:

http://help.solidworks.com/2012/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISldWorks~OpenDoc6.html

 

1 Like