No ma'am that is not what I want to create
I want to insert two different solidpart files in one document.
Its like the boolean operation where you superimpose two parts and figure out the common area between them.
(Insert--Part-- choose part command in solidworks)
dim instance as new partdoc is wrong anyway
or you need to open first doc
or you have to use activedoc
I think issue in Dim Instance as New PartDoc.
Please try it like this.
static void Main(string args)
SldWorks SwApp = (SldWorks)System.Runtime.InteropServices.Marshal.GetActiveObject("sldworks.Application");
PartDoc SwModel = SwApp.NewPart();
Dim swApp As SldWorks.SldWorks
Dim swpart As SldWorks.PartDoc
Set swApp = Application.SldWorks
Set swpart = swApp.NewPart
swpart.InsertPart2 "C:\Users\MBB2\Desktop\FM\Ctyl.SLDPRT", swInsertPartOptions_e.swInsertPartImportSolids
Thanks Manikandan Babu!!!. Your example code worked