|
add 2 buttons on the toolbar
i used this code to add 2 icons on the toolbar and expectd to see icon 101 and 103
what i see is two icons 101 appeared on the toolbar
what am i doing wrong here:
thx, chris
itoolbarid = isldworks.addtoolbar3(icookie, "drawing tools_1", 102, 101, -1, swdoctemplatetypedrawing)
itoolbarid = isldworks.addtoolbar3(icookie, "drawing tools_1", 104, 103, -1, swdoctemplatetypedrawing)
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
edited: 06/17/2008 at 05:14 pm by chris ch
hi chris,
try using the latest toolbar function
sldworks::addtoolbar4.
in the help pages an example is also included so have a look there. if that doesnt help reply here again.
--stav.
in this world i am nobody...
and nobody is perfect ;) !!!
---------
solidworks office 2008 sp4.0
dell precision pws390
nvidia quadro fx 3450/4000 sdi
sldworks::addtoolbarcommand2 is what adds buttons to a toolbar once the toolbar is created using addtoolbar3 (or 4).
as i mentioned in the other thread, addtoolbar4 causes the toolbar disappeared?
roland,
i did use addtoolbarcommand2 to add buttons and it works fine. the only problem i have here is the toolbar shows 2 identical icons on 2 buttons
thx, chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
as i mentioned in the other thread, addtoolbar4 causes the toolbar disappeared?
roland,
i did use addtoolbarcommand2 to add buttons and it works fine. the only problem i have here is the toolbar shows 2 identical icons on 2 buttons
thx, chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
respectfully, you are contradicting your original post. in your op you are using addtoolbar3 and make no mention of addtoolbarcommand2.
roland,
i believe the addtoolbarcommand2 works fine in my program. pressing on first button will update the date and time and second button will call out the revision table editor.
what i have trouble here is addtoolbar3
i expected to see a toolbar "drawingtools_1" including two buttons with diff. icons (101 and 103 ) on them. what i see is 2 identical icons (101) on two buttons.
plase see the code below and att. image
itoolbarid = isldworks.addtoolbar3(icookie, "drawing tools_1", 102, 101, -1, swdoctemplatetypedrawing)
itoolbarid = isldworks.addtoolbar3(icookie, "drawing tools_1", 104, 103, -1, swdoctemplatetypedrawing)
bret = isldworks.addtoolbarcommand2(icookie, itoolbarid, 0, "datentime_command", "datentime_commandupdate", "date and time stamp", _
"update date and time on the title block")
bret = isldworks.addtoolbarcommand2(icookie, itoolbarid, 1, "revtable_command", "revtable_commandupdate", "revision table editor", _
"edit revision table")
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
now i get it. something very wrong w/ your toolbar bitmap.
you need to create a single bitmap with all of your buttons shoulder-to-shoulder. sw will parse and space the buttons from a single bitmap. you don't add icons individually.
you should on;y need to addtoolbar3 one time.
see the powerpoint in the "addin from macro" project on my website
thank you roland.
i used to add the bitmap indivisualy in inventor and expected the same way in solidworks
by the way, do you know an easy way or any freeware to add the bitmap shouldertoshoulder?
thx, chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
i just use ms paint. i create the bmp's individually and then cut-and-paste into a composite. start w/ a 16 x 15, then add another 15 width and then paste next button.
thx, roland
it works nicely now
the only question i have now is
1) why addtoolbar4 causes the toolbar disappeared
2) how to control the space between the buttons?
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
edited: 06/18/2008 at 01:26 pm by chris ch |
|