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!

Solidworks Window in VB application

Status
Not open for further replies.

nikhiljoglekar

Mechanical
Apr 8, 2003
17
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
 
Replies continue below

Recommended for you

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.
 
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
 
>>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



 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor