几何尺寸与公差论坛

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

【转帖】not to update assembly

[复制链接]
发表于 2009-4-12 21:56:01 | 显示全部楼层 |阅读模式
not to update assembly
hi,
i have a macro that opens all the parts of an assembly one by one and closes each one before it opens another one and flattens the opened part but it updates in the assembly right away and causes an error with my assembly because of other parts are referenced to this part. if i manually open a part and flatten it and spit my window to see the assembly and the opened part it flattens in the assembly aswell but does not update the references and if i fold it back up and close it the assembly is fine. could somebody give an idea why this is happening ? thanks.
this is the code it use to flatten:
if swfeature.gettypename2 = "flatpattern" then
swfeature.select2 false, -1
modeldoc.editunsuppress
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
the assembly has the part loading silently in the background as a reference so "opening" the part just makes it visible as it is already loaded, so the assembly will automatically update any changes.
you can try checking "open referenced documents with read-only access" in the external references system options to see if that prevents the update
i checked that and still does the same thing. hmmm...
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
answer maybe i should not have posted so soon.
using this code it does not update the assembly while the part is open at least not the references.
set swapp = createobject("sldworks.application")
set part = swapp.activedoc
set selmgr = part.selectionmanager
boolstatus = part.extension.selectbyid2("flat-pattern1", "bodyfeature", 0, 0, 0, false, 0, nothing, 0)
part.clearselection2 true
part.setbendstate 2
boolstatus = part.editrebuild3
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-23 13:55 , Processed in 0.036024 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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