Hallo Freunde
Ich habe ein Stück Skript, bei dem die Löcher einen "Part" erhalten. mein Problem ist, dass ich nicht identifizieren "Rectangular/circular Patern".
Jemand helfen könnte mich wissen, die Gesamtzahl der Löcher nach der Verwendung eines "patern" Vollendung des Codes
Hielt "Edge Fillet" ich auch ein "Hole"
Dies ist der Codeabschnitt
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("PartBody")
Dim shapes1 As Shapes
Set shapes1 = body1.Shapes
dim selection1 as selection
set selection1=CATIA.activedocument.selection
selection1.clear
for i = 1 to shapes1.count
selection1.add shapes1.Item(i)
NEXT
Dim xSelObj() As Variant
Dim xObj As Variant
Dim n as Integer
Dim myObj As AnyObject
Dim nCount As Integer
nCount = 0
for n= 0 to shapes1.count
On Error Resume Next
Set myObj = selection1.FindObject("CATIAHole")
ReDim Preserve xSelObj(nCount)
Set xSelObj(nCount) = myObj
nCount = nCount + 1
next
' Listing holes
Dim sList As String
Dim nI As Integer
'Loop for message
For nI =0 To ncount-3
dim referenceX as reference
Set referenceX = part1.CreateReferenceFromObject(xSelObj(nI))
Next
part1.Update
Msgbox ncount-2
End Sub
Vielen Dank im Voraus
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP