I'm trying to call a Sub-Assembly from within theRoot-Assembly. The Sub-Assembly is active for editing. What wouldbe the call to get the active Assembly name regardless if it is theRoot 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)
SolidworksApi macros
' 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)
SolidworksApi macros