×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Has anyone used the OpenDoc6 in SW 2003

Has anyone used the OpenDoc6 in SW 2003

Has anyone used the OpenDoc6 in SW 2003

(OP)
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.

RE: Has anyone used the OpenDoc6 in SW 2003

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
http://solidworks.cad.de
Shareware, freeware, tools and macros
http://swtools.cad.de

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources