几何尺寸与公差论坛------致力于产品几何量公差标准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, 03:07 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】updating the design library tab in the task pane

updating the design library tab in the task pane
i have written an add-in for sw 2008 that refreshes the cache for each of the pdmworks enterprise vaults that a user is logged into at the beginning of their solidworks session. upon completion of caching, i set the content manager folders value of the hkcu\software\solidworks\solidworks 2008\extreferences key to the proper path(s) of the vaults that have been refreshed. i want the user to have access to the mil-spec parts in each of the vaults via the design library tab when the sw interface loads completely.
however, when the user interface load is complete, the design library shows the mil-spec part library(s) that were represented in the registry setting prior to my change. this means that a user would have to exit and re-enter sw inorder to access the correct mil-spec parts.
i have tried refreshing the task pane using the api call sldworks.refreshtaskpanecontent as shown in the following code:
'refresh design library view
iswapp.refreshtaskpanecontent()
this returns s_ok, implying that the call has completed successfully. i'm guessing that it is not working correctly since the user interface is not fully loaded at the time of the call?!?
does anyone have a suggestion for making this work?
thanks,
eric
traditional flint ridge greeting:
it's not much of a house, but we've got one heckuva basement!
your problem is that sw reads the registry upon loading, and by the sounds of it does not reread the registry values until restart, which is usually the case for most programs. that could be wrong though.
the documentation implies that you can use iswapp.refreshtaskpanecontent() to refresh the content of the design library tab. this would entail a re-reading of the registry - if you go to tools\options\filelocations\designlibrary and add a file folder, the interface immediately updates the design library tab to reflect the change.
i am guessing that the interface is leveraging the iswapp.refreshtaskpanecontent() call to update - am i wrong?
thanks,
eric
traditional flint ridge greeting:
it's not much of a house, but we've got one heckuva basement!
i think i had a similar issue regarding updating the template locations through code that didn't update until restart or something similar but that was a while ago and i am not sure if those settigns are even in the registry i never looked.
i will have a play tomorrow see what i can do
i played around with the iswapp.refreshtaskpanecontent() call today, invoking it after the sw user interface was completely loaded. no dice - it just rearranges the folders of the tree on the design library tab. it doesn't refresh the actual content from the registry. :-(
so i began to wonder how the interface refreshes the tab when you change the file locations through the tools\options\filelocations\designlibrary. i perused the api docs and found the iswapp.activatetaskpane call. it asks for a param from the swtaskpanetab_e with 0 being the swdesignlibrary tab.
i tried this with no good result, but i have to think that if i can find a corresponding call that will allow me to deactivate the tab and then reactivate it with the iswapp.activatetaskpane that i may get the desired result...
any thoughts on how to accomplish deactivation?
thanks,
eric
traditional flint ridge greeting:
it's not much of a house, but we've got one heckuva basement!
i cannot find any function to deactivate a task pane, only a notification when it does, indicating it is deactivated internally depending on conditions. you may want to shoot an email to api support.
have you tried actually setting the tools options design library paths through the code before the refresh of the taskpane? i don't think you need to write any values to the registry. if they are updated in the options via code then when solidworks exits properly, solidworks will write the proper registry settings.
look for swuserpreferencetoggle_e in the help. it may be there.
jeff
oops - forgot to post that i got this working:
after i set the content manager folders value of the hkcu\software\solidworks\solidworks 2008\extreferences key to the proper path of the vaults that have been refreshed (ended up forcing a single vault per user),
i do the following:
iswapp.setuserpreferencestringvalue(swconst.swuserpreferencestringvalue_e.swfilelocationsdesignlibrary, scurrvault)
'refresh design library view
iswapp.refreshtaskpanecontent()
this forces the design library tab to refresh as desired!
traditional flint ridge greeting:
it's not much of a house, but we've got one heckuva basement!
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】need some help making a task manager tab yang686526 SolidWorks二次开发 0 2009-04-12 09:52 PM
【转帖】modifying design table values with a macro yang686526 SolidWorks二次开发 0 2009-04-12 09:49 PM
【转帖】how to create activex control in vb.net for use in tab via addcontrol3 yang686526 SolidWorks二次开发 0 2009-04-12 09:14 PM
【转帖】dll学习(资料收集) huangyhg vc编程 0 2008-05-17 09:24 PM


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


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