Executes SolidWorks with no GUI but still uses the SolidWorks API to load and query parts or assemblies.

17 Oct

Original article is found here, but here is the snippet:

“I first tried to use OpenDoc6 as follows:

  • swApp->OpenDoc6(L”C:\\cygwin\\home\\ganesh\\downloads\\imagecom\\batch\\camtest.sldprt”, swDocPART, swOpenDocOptions_Silent, L”Default”, &fileerror, &filewarning, &swModel)

  • By doing that, SolidWorks started up with its GUI and then tried to load the model, which was not what we wanted. Next I tried an old API OpenDocSilent() as follows:
    • swApp->IOpenDocSilent(sFileName, swDocPART, &fileerror, &swModel)

  • This had the required effect of opening SolidWorks silently and loading the model in it.
  • The other big problem I noticed was: IF YOU LOAD A READ-ONLY SLDPRT INTO SOLIDWORKS USING OPENDOCSILENT(), FOR SOME REASON SOLIDWORKS STARTS UP WITH GUI. The only solution I have for this at the present is to not load read-only parts or assemblies.”
Leave a comment

Posted by on October 17, 2008 in General


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: