engAlright
Mechanical
- Jun 12, 2003
- 240
Has anyone had any problems with the basic Solidworks objects in Solidworks 2005? My code includes the following lines in a sub (pretty standard stuff):
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Debug.Print swModel.GetPathName
When I run the code I get a run-time error 91: "Object variable or with block variable not set" at the debug.print line above. The swmodel variable is also "nothing" at the point where the error occurs, even though Solidworks 2005 is running and I have a document open. I'm using VB6.
Any thoughts?
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Debug.Print swModel.GetPathName
When I run the code I get a run-time error 91: "Object variable or with block variable not set" at the debug.print line above. The swmodel variable is also "nothing" at the point where the error occurs, even though Solidworks 2005 is running and I have a document open. I'm using VB6.
Any thoughts?