×
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

Solidworks Window in VB application

Solidworks Window in VB application

Solidworks Window in VB application

(OP)
hi all
I am working for a project where I need to embed the Solidworks window inside my VB forms. Is it possible? I couldn't find the direct way of doing it. If anybody can help me out that'll be great.
thanks in advance
Nikhil

RE: Solidworks Window in VB application

Its buggy , and doesnt like configurations .

Drop an OLE control on your form, choose 'create from file', browse to your file, and then hit the Help files. I had the best success with drawingdocs.

RE: Solidworks Window in VB application

(OP)
hi rocheey
thanks for the quick reply. However I want to open the files interactively and should be able to work with these.
also when you say choose the file, is it solidworks file or some type library you want me to choose?
regards
Nikhil

RE: Solidworks Window in VB application

>>I want to open the files interactively and should be
>>able to work with these.


You will. It just drops a bitmap-type image on the screen
until you activate it, by available methods, thru code.
You can pop up a common dialog for the user to select a
file from, and then use the OLE.CLASS and OLE.SOURCEDOC
properties to assign to the OLE window.

To step thru it:
1) Start a new (standard exe) VB project, and on the form,
   drop an OLE control.
2) A dialog now pops up for "Insert Object" ...
   select "Create from file", and browse to a .SLDDRW file.
  Click "OK", and give it a minute to set up.

3) Resize your Form, and OLE control, to the max size you
   want. Change the "SizeMode" Property to "Stretch",
   change the "AutoActivate" property to "GetFocus".

4) In you Form.Load procedure, set the focus to the OLE
   control using "OLE1.DoVerb vbOLEShow"

5) to get the dwg OBJECT, like in SW, use OLE.Object



RE: Solidworks Window in VB application

(OP)
hi rocheey
thanks for the reply. It was very helpful.
However can I get all SW interaction and menus in this OLE control?
Like if I want to change some feature and things like that?
regards
Nikhil

RE: Solidworks Window in VB application

No, at least I dont think so. I realized early on that it was limited. Your best best is to stay with SW.

If you've done any subclassing with VB, tho, there are some, shall we say, interesting things you can do to.. err, WITH, an app... take over its menus, titlebars, windows, force it to move along with your own application, etc...  and generate the same effect, that of either SW being part of your application, or integrated with your application

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