|
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 |
|