几何尺寸与公差论坛

 找回密码
 注册
查看: 877|回复: 0

【转帖】solidworks preview in visual studio 2005

[复制链接]
发表于 2009-4-13 14:33:03 | 显示全部楼层 |阅读模式
solidworks preview in visual studio 2005
is it possible to show the preview of a solidworks file in visual studio 2005 form?
sldworks:getpreviewbitmap does not work outside solidworks application
any other way to display?
mathew varghese
flowserve
nope. the only way is to create a dll class library structured as a sw addin and add a public function that accepts your required parameters (model path, configuration name etc...) and then get the preview bitmap, save it to a file and return the saved path back to the calling object. make the class com visible, then from your app get the addin class object (getobject()), call the public function, and read in the bitmap from the saved location.
of course if you want to get even more complex you can just use windows low level system hooks to hook into the sw running instance, get a handle to the window class and call a win32 function to get that handles viewable area as an image stream.
both of these methods are fairly advanced so unless you understand what i have just said i wouldn't attempt it!
could always use the edrawings api to open the sw file assuming your clients are selecting some kind of file...
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 00:05 , Processed in 0.036190 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表