Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Solidworks Add-in... 1

Status
Not open for further replies.

Guest
HI!!


I want to do a solidorks add-in showing a toolbar in VB, with the new interfase SWaddin and the command addtoolbar3.
But I've some problems with the function addtoolbar3 and addtoolbarcommand.I don't know how to get handles of bitmaps(addtoolbar3),and how to put the name of my callbackfunction(addToolbarCommand).
Is Someone who can send a bit of code in order to help a poor guy working during hollidays to pay his studies....
 
Replies continue below

Recommended for you

I don't know how to to create your own toolbar, but...the native Macros toolbar already has buttons on it, to which you can assign a pointer to run whatever macro you may have stored. I don't know if you can assign more than 10 tho?
 
MHendler,
This sounds hopeful. I did not know, that Visual Basic could add a button to the tool bar. I know about the macro tool bar. Can you create other buttons on the SolidWorks tool bar?
brad_johnson@dstoutput.com
Bradley
 
MHendler,
I would like to take a look at your example file too...I'm tring to create one here myself, but not having any luck. You can send it to: bolen.16@osu.edu
Thanks,
Ken Bolen
 
MHendler,
I would also like to take a look at your sample.
Thank you. DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
Hi,

Could anybody send also me the code?

I have problem on my add-in


hToolBar = pSldWorks.AddToolbar3(swCookie, "My ToolBar", 102, 101, 5, swDocTemplateTypeASSEMBLY)

pSldWorks.AddToolbarCommand2 swCookie, hToolBar, 0, "Toolbar_Callback", 0, "titolo ToolBar", "pick me"


thank

Massimiliano
 
I would like to take a look at your example file too...I'm not having any luck at all. You can send it to: wim.vancoillie@stas.be

Thanx,
Wim Vancoillie
 
I did not have much API-generated success myself, but as of SW2k1+, the VBA has a modeless form. You can 'cheese' out a toolbar (if you dont mind it having a title bar) by just dropping image controls on a Userform, and sizing the form around it. And when you show the form as modeless, you can constantly interact with SW, and the 'toolbar' is already floating on top.
 
I don't know if any of you are aware of this or not (and if you are I apologize for the redundant infot) but in the API support section of the SolidWorks website I found a code example (in VB) for doing exactly what's being discussed here. While I have downloaded it I admit to only giving the code a quick once over and have not completely digested the specifics of how it works. It's probably worth a look though at least to some.

Chris Gervais
Mechanical Designer
American Superconductor
 
MHendler,

there's so much interest around your piece of code that you should post it into FAQs. I would like to take a look at your code, too.

Andrew

Rawhead Rex,

can you be alittle more specific, pls.

A.
 
Everyone,

Here is the link to the SolidWorks API Support website Code Example section. I looked again and specifically, the code example (in VB) is a Visual Basic COM DLL addin project. Again I don't know whether or not this helps anyone out but on the outside chance that it might stimulate some ideas I figured it worth mentioning. It's certainly something that I plan on giving serious consideration to make use of.


Chris Gervais
Mechanical Designer
American Superconductor
 
Status
Not open for further replies.
Back
Top