几何尺寸与公差论坛------致力于产品几何量公差标准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:43 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】add-in how to show in menu, but dont show icon

add-in?? how to show in menu, but don't show icon
i have my add-in working!!! thanks to everyone for their help. i do have one final question though. i am putting together a help file. i would like "help" to appear in the drop down on the solidworks menu bar, but i don't want the icon to appear in the toolbar. how can i go about this? like usual, any help is appreciated.
thanks!
tony szuta
cswa, cswp, cswp-smtl
being a bit lazy today so not even looking in the api, but off the top of my head, you can create a bitmap that is 16x16px with all pixels being the transparent color, and set it to that, effectively creating a transparent icon.
there is probably a proper way to do this though, i presume its simply not setting the icon by passing nothing/null instead, or setting index to -1 so something similar.
i have tried a few different things including your idea luke but i have had no luck. when i set the icon to nothing, it is represented by an empty black square. i have contacted api support and have had an sr# assigned. if anyone has any suggestions before their response, please feel free to post.
tony szuta
cswa, cswp, cswp-smtl
tony,
maybe i an missing something, but have you already put a menu item in sw help menu? i have seen a help page in api regarding that.
regards, basil
"and when you loose control,
you'll reap the harvest you have sown..." (c) pink floyd
solidworks 2008 x64 sp5.0 (production)
solidworks 2009 x64 sp2.0 (testing)
windows xp x64 sp2
core2quad 6600, 4gb ram, 500gb sata, ati firegl v7700 1024mb (softmodded from hd3850), 19" tft
hi tony
as i don't know how you've create your menu (i believe you've used the commandgroup interface). you can use the addmenuitem3 method to had an entry in your menu with no icon. it work, i've starting to use it.
hope this help
################################
stef
designer / cad administrator
sw 2007 sp5 winxp pro sp2
here is the code that i have used. it is direct from the vb.net add-in template. i just changed it to suit my needs.
public sub addcommandmgr()
dim cmdgroup as icommandgroup
dim ibmp as new bitmaphandler
dim thisassembly as assembly
thisassembly = system.reflection.assembly.getassembly(me.gettype())
cmdgroup = icmdmgr.createcommandgroup(1, "emteq", "emteq add-in", "", -1)
cmdgroup.largeiconlist = ibmp.createfilefromresourcebitmap("emteq.toolbarlarge.bmp")
cmdgroup.smalliconlist = ibmp.createfilefromresourcebitmap("emteq.toolbarsmall.bmp")
cmdgroup.largemainicon = ibmp.createfilefromresourcebitmap("emteq.mainiconlarge.bmp")
cmdgroup.smallmainicon = ibmp.createfilefromresourcebitmap("emteq.mainiconsmall.bmp")
cmdgroup.addcommanditem("custom properties", 0, "add and modify custom properties", "custom properties", 0, "customproperties", "", 0)
cmdgroup.addcommanditem("pdf creator", 1, "create pdf from current drawing", "pdf creator", 1, "pdfcreator", "", 1)
cmdgroup.addcommanditem("part number generator", 2, "generate new part number", "generate new part number", 2, "generatepn", "", 2)
cmdgroup.addcommanditem("help", 4, "solidtools help", "solidtools help", 3, "help", "", 3)
cmdgroup.addcommanditem("check for updates", 3, "check for solidtools updates", "check for solidtools updates", 4, "checkforupdates", "", 4)
cmdgroup.hastoolbar = true
cmdgroup.hasmenu = true
cmdgroup.activate()
thisassembly = nothing
ibmp.dispose()
end sub
i have attached an image of my menu and tool bar. i don't want the help icon to show on the tool bar. i will examine "addmenuitem3" stéphane.
thanks!
tony szuta
cswa, cswp, cswp-smtl
answer stéphane,
addcommanditem2 worked for me.
thanks to all!
tony szuta
cswa, cswp, cswp-smtl
hi tony
which colors do you've used for the background of your icon? in the api help they said you need to set it to rgb: 192,192,192 but i've a grey background. i fyou can help me......
hope this help
################################
stef
designer / cad administrator
sw 2007 sp5 winxp pro sp2
the most common transparency key is magenta, so try that (255 000 255)
hey tony,
i too am just starting into the api and would like to also add a custom pulldown menu with my addin. i have the 'swaddin template 1.3 setup' template but this doesn't contain any example code for this pulldown menu (that i can see). i see your code posted here and i think i'll be able to borrow and modify. i hate to sound totally clueless but what do i do with this code and where do i put it into the 'swaddin template?
if someone could point me into the right direction or offer a barbones example project with pulldowns like tony posted in the picture above.... i would greatly appreciate it!!!!! i really want to learn how to this!
i should also mention i tried this in vb 6. but i noticed you did this in .net
do i need to have vs 2005 or 2008?
many thanks!
don
edited: 04/23/2008 at 07:07 pm by don van zile
i am going to look into the "transparent" color.
don,
i was not having problems adding the drop down. i wanted things to appear in the drop down, but not on the tool bar. the drop down is "standard code" in the vb.net ad-in template that i used.
tony szuta
cswa, cswp, cswp-smtl
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】add menu picks to the existing menu yang686526 SolidWorks二次开发 0 2009-04-13 08:42 AM
【转帖】how to find the position of a menu item yang686526 SolidWorks二次开发 0 2009-04-12 09:16 PM
【转帖】if showmodal = false then macro does not pause at form show yang686526 SolidWorks二次开发 0 2009-04-12 06:41 PM


所有的时间均为北京时间。 现在的时间是 01:13 AM.


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