几何尺寸与公差论坛

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

【转帖】active sub assembly name

[复制链接]
发表于 2009-4-12 20:05:53 | 显示全部楼层 |阅读模式
active sub assembly name
i'm trying to call a sub-assembly from within the root-assembly. the sub-assembly is active for editing. what would be the call to get the active assembly name regardless if it is the root or the sub. tried this but doesn't work.
' assembly for editing is active
assynameactive = swassy.getedittargetcomponent.name2
' i've already selected the plane within the sub assy
set itemplane = swselmgr.getselectedobject6(1, -1)
set swfeat = swmodel.createplaneatoffset3(0, false, true)
swfeat.name = "tempplane"
itemplanename = swfeat.name
itemplanenameactive = itemplanename + "@" + assynameactive
' i call back to select it. this is where it fails. itemstatusb comes back as false.
itemstatusb = swmodeldocext.selectbyid2(itemplanenameactive, "plane", 0, 0, 0, false, 0, nothing, 0)
' if i use this at the root assy then its true.
itemstatusb = swmodeldocext.selectbyid2(itemplanename, "plane", 0, 0, 0, false, 0, nothing, 0)
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
answer then use this
swfeat.select false
thank you ivana. that worked perfectly.
' assembly for editing is active
assynameactive = swassy.getedittargetcomponent.name2
' i've already selected the plane within the sub assy
set itemplane = swselmgr.getselectedobject6(1, -1)
set swfeat = swmodel.createplaneatoffset3(0, false, true)
swfeat.name = "tempplane"
itemplanename = swfeat.name
' this gives me true regardless of location
itemstatusb = swfeat.select(false)
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-23 06:27 , Processed in 0.035653 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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