Isolate External References Macro
Isolate External References Macro
(OP)
Is there a macro that will search an assembly and select all external references and Isolate them?
I would like to isolate every reference except those pointing to Published elements.
I would like to isolate every reference except those pointing to Published elements.





RE: Isolate External References Macro
- If an external reference is bad/not connected
- The parent of an external reference
From my experience:RE: Isolate External References Macro
For i = 1 To myDocuments.Count
If InStr(1, myDocuments.Item(i).Name, ".CATPart") > 0 And InStr(1, myDocuments.Item(i).Name, ".CATProduct") <= 0 Then
myPart = myDocuments.Item(i).Part
Dim iBodyCnt As Integer
iBodyCnt = myPart.HybridBodies.Count
For j = 1 To iBodyCnt
If j >= iBodyCnt Then Exit For
If myPart.HybridBodies.Item(j).Name = "External References" Then
Dim myHBBody As HybridBody
myHBBody = myPart.HybridBodies.Item(j)
Dim k As Integer
For k = 1 To myHBBody.HybridShapes.Count
Debug.Print(myPart.Name & " - " & myHBBody.HybridShapes.Item(k).Name)
mySelection.Add(myHBBody.HybridShapes.Item(k))
iCnt = iCnt + 1
Next
If mySelection.Count2 > 0 Then
' Create Alias for Isolate
'CATIA.StartCommand("IsolateObject")
CATIA.StartCommand("Isolate")
mySelection.Clear()
End If
End If
Next
End If
Next
MsgBox("Isolating " & iCnt & " External Referances - Done", vbInformation, "Isolate External Referances")
RE: Isolate External References Macro