MrMiller
Aerospace
- Jan 30, 2004
- 54
Does anyone know the code to open a part from an assembly by selecting the part under the assembly tree. This is the code I have now and it doesn't work. I have this similar code to open the part by selecting a face, edge or vertex and it works for those selected items.
If (selType = swSelCOMPONENTS) Then
Set selComp = swSelMgr.GetSelectedObjectsComponent2(1)
Set owningComponent = selComp.GetComponent
strmodel = owningComponent.GetPathName
Set swModel = swApp.ActivateDoc2(strmodel, True, 0)
strModelName = owningComponent.Name
End If
If (selType = swSelCOMPONENTS) Then
Set selComp = swSelMgr.GetSelectedObjectsComponent2(1)
Set owningComponent = selComp.GetComponent
strmodel = owningComponent.GetPathName
Set swModel = swApp.ActivateDoc2(strmodel, True, 0)
strModelName = owningComponent.Name
End If