ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
AKAlexander Klammer22/01/2018

Hi,

I just tried to create a Stand Alone Application.

However i tried to connect to my current Solidworks App.

With these two methods:

SldWorks swApp = (SldWorks)Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application"));

SldWorks swApp = (SldWorks)System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks.Application");

However i just was not able to get the first one going - when i tried to set swModel to the Active doc it always returned 0:

(swModel = (ModelDoc2)swApp.ActiveDoc;)

Any ideas what´s going wrong here?

The second one worked but "just" when both - the Stand Alone App and SolidWorks where running as Administrator.

I guess this is "normal" behaviour, but i´d like to make some stand alone applications for our engineers and running the stand alone app and solidworks as administrator won´t be possible because of user permissions.

Does anyone have a solution for that?

BR

Alex