查看单个帖子
旧 2009-04-13, 02:33 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】solidworks preview in visual studio 2005

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