Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Has anyone used the OpenDoc6 in SW 2003

Status
Not open for further replies.

JpPhysics

Mechanical
Mar 25, 2002
35
I am trying to open a drawing Docuemnt, but cannot get it to work.

Here is the code:

Dim RetVal as Variant

RetVal = SolidWorks.Application.OpenDoc6(
"Drawing.slddrw", 3, 5, "", 0, 0)

Can anyone see the problem? And yes, I have tried declaring RetVal as an object, as a ModelDoc2 and as a DrawingDoc.

Thanks,

John G.
 
Replies continue below

Recommended for you

You have to declare RetVal as an object (as you described), but then you have to use the Set command:

Dim RetVal as Object
Set RetVal = SolidWorks.Application.OpenDoc6("Drawing.slddrw", 3, 5, "", 0, 0)

This is a MUST for all objects in VB, you have to use Set.

HTH,
Stefan --
unofficial german SolidWorks helppage
Shareware, freeware, tools and macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor