AnsweredAssumed Answered

C# StandAlone application - Create Solidworks instance

Question asked by Michael Corriveau-Cote on Aug 17, 2018
Latest reply on Aug 17, 2018 by Artem Taturevych

Hey everyone,

 

I'm trying to create a Solidworks Standalone Application. After many attempts, i can't seems to create a Solidworks instance. either it fails (error) or swApp is  null.

 

        /// <summary>
        /// https://www.codestack.net/solidworks-api/getting-started/stand-alone/
        /// </summary>
        /// <returns></returns>
        static public SldWorks Connect2Solidworks()
        {
            SolidWorks.Interop.sldworks.SldWorks swApp= new SolidWorks.Interop.sldworks.SldWorks();
            return swApp;


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


            //return Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application.24")) as SldWorks;
        }

 

Erreur Com.PNG

Outcomes