几何尺寸与公差论坛

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

【转帖】api to create partdoc objec

[复制链接]
发表于 2009-4-13 08:59:56 | 显示全部楼层 |阅读模式
api to create partdoc object
i am trying to create new ipartdoc object ( using vc++ com). is their any api available to do this in sw2008 api .
also is their any api gives copy of partdoc object something similar to body2.copy() .
thanks
avadhani
hi there,
i am not sure i understood what you are trying to do but here we go anyway.
if you have a part document open in solidworks use :
sldworks::iactivedoc2. this will return the currently active document.
if you want to create a new part doc use:
sldworks::inewdocument2
and make sure you use the part template. this function will return you the newly created part doc object
why do you need a copy of the partdoc?
how are you going to use it that requires you having a copy of it?
--stav.
in this world i am nobody...
and nobody is perfect ;) !!!
---------
solidworks office 2008 sp4.0
dell precision pws390
nvidia quadro fx 3450/4000 sdi
edited: 10/01/2008 at 06:59 am by stavros antoniou
i was refering to one of api examples present in solidworks website. (how to export selected assembly component as a parasolid file) solution they provided is create temporary part , add bodies to it and then save that temporary part. so in this context ,
i need to create new partdoc (in vc++ com)
or
i can create just copy of partdoc i,e, as temporary part and save it. in this way this helps me copying of partdoc.
i can also edit the temporary part without disturbing original part.
thanks
answer to create a new part use:
sldworks::inewdocument2
and use the part template
to create a copy of a part use:
modeldocextension::saveas
and in the options use swsaveasoptions_e.swsaveasoptions_copy
cheers,
--stav.
in this world i am nobody...
and nobody is perfect ;) !!!
---------
solidworks office 2008 sp4.0
dell precision pws390
nvidia quadro fx 3450/4000 sdi
why it doesn't work for my application?
environment:
solidworks2008 sp4.0 32bit
vb.net 2008
windows xp 2002 professional
edited: 10/08/2008 at 11:00 am by shelley hankey
you 'll have to be a bit more precise shelley.
what exactly does not work?
--stav.
in this world i am nobody...
and nobody is perfect ;) !!!
---------
solidworks office 2008 sp4.0
dell precision pws390
nvidia quadro fx 3450/4000 sdi
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 02:02 , Processed in 0.036628 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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