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

thumbnail
hi everyone
anna wood suggested i come here to see if someone could help.
point one:
i would like to get sw to update the thumbnail ever time i hit the save.
point two
i have a part number creation spread sheet in excel and i would like to have a picture ref to the thumbnail for prt, ass and drw.
anna suggested that it would take a api in excel or something to achieve it. i have very little knowledge of such things could someone help?? ,,,,,,, please
i love to design
doug@saol.com
as for the first request; i could swear there was a simple check-box in the options somewhere to tell it to update the preview image on save, but for the life of my i cannot find it?
as for the second request. your best bet is to use the document manager to extract the actual bitmap from the files and then place it as the source of a picturebox in excel. you could have this running every time the excel sheet opened or just on a synchronise basis where to save the bitmap to file and reference them. unfortunately this is not exactly a beginners level task so you would probably struggle.
luke,
do you have any experience with this functionality? i got curious and wrote a macro using sldworks::getpreviewbitmap (macro attached). it does work (saves out a bitmap), but contrary to the api help the picture is not the same as what you see in the solidworks "open" dialog. it seems to be just a screenshot of the model window at the time of the last save rather than the nice isometric picture in the dialog. i seem to recall something about the preview image being improved for 2006, 2007, or 2008. maybe that has something to do with it. i haven't tested the document manager function of the same name. another thing i wanted to look at but am not really sure if it will even work for me is sldworks:reviewdoc. i only have vba, so i don't know if i'd be able to figure out what to use for the hwnd argument.
i'll get you eh steve, if it's the last thing i dooooo!
edited: 01/16/2009 at 08:28 am by josh brady
yes the previewdoc, getpreviewbitmap, and dm getpreviewbitmap all pull in the same data and it should be correct. it is more likely that the open dialog is either pulling in a configuration specific preview, or a cached version so the two mismatch.
thanks ........ i think
josh the macro works, at first i thought it was not working till i fond the bitmaps in the same folder as the file.
sorry, is everyone saying that one can not write a vba in excel to do the same as this macro, which could then save to a selected cell?
i love to design
doug@saol.com
edited: 01/16/2009 at 09:40 am by doug davey
did you try out the macro i posted? i get the general preview and the previews for each configuration. it is definitely pulling in a screenshot of the last-saved view of the model or drawing. the size of the bitmap is even exactly the same size pixel-wise as the model window. if i zoom/pan/rotate and then save the model/drawing and pull the bitmap again it reflects the new screenshot. i guess there's no way to access the pretty isometric view that shows up in the open dialog and on the ctrl-tab thumbnail preview?
i've attached a version that uses the document manager. add license key string and stir.
i'll get you eh steve, if it's the last thing i dooooo!
can you even put a picture into a cell? i can't see how to insert any picture into a cell of a spreadsheet, via programming or manually.
i'll get you eh steve, if it's the last thing i dooooo!
activesheet.range("g10").select
activesheet.pictures.insert( "path\name.jpg" )
i have attached josh's sw macro as excell macro.
you must make reference to "c:\program files\common files\solidworks shared\swdocumentmgr.dll"
and you need access key for document manager from
note that this code just dumps the picture on top of the excel sheet with its top-left corner in the selected cell. it does not put the picture in a cell.
i'll get you eh steve, if it's the last thing i dooooo!
originally posted by: josh brady
note that this code just dumps the picture on top of the excel sheet with its top-left corner in the selected cell. it does not put the picture in a cell.
that is true
i can design an aircraft but you seem to have me over a log. i am so grateful for you help .... really mean that.
what and where is document manager?
how do i ask for an access key?
again thank you so much for your help, if you ever need something designed, i would love to help.
thank you josh. thank you ivan and thanks everyone else
i love to design
doug@saol.com
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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