几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 08:40 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】add 2 buttons on the toolbar

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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】2007 toolbar and icon descriptions yang686526 SolidWorks二次开发 0 2009-04-13 08:35 AM
【转帖】how do i add a separator on a custom addin toolbar yang686526 SolidWorks二次开发 0 2009-04-12 09:09 PM
【转帖】如何编写ToolBar的ButtonClick事件 huangyhg 程序界面 0 2008-11-12 11:44 AM


所有的时间均为北京时间。 现在的时间是 11:14 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多