Can Any one kindly help find why it doesn't work?
I have made a few other stand-alone exe with solidworks and they work fine.
Thank you very much.
Can you check the following code: -
Dim swApp As SldWorks.SldWorks
swApp = New SldWorks.SldWorks()
if not swApp is nothing then
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Part = swApp.ActiveDoc
If not Part is Nothing then
Dim swModelExtension as SldWorks.ModelDocExtension
swModelExtension = Part.Extension
If Not swModelExtension is nothing then
boolstatus = swModelExtension.SelectByID2("Sketch1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
swModelExtension = nothing
Part = Nothing
swApp = Nothing
Hope it helps!!!
I had the same problem problem. But I solved it.
Just use Dim Part as SldWorks.ModelDoc2 instead of Dim Part as Object
Hope it will help.