HarunMusic
Computer
Hi, can anyone help me with the macro who will Count Points in CATIA.
I founded this macro who Count sketch based Features, but i dont know how to Count Points, any help
thx
Sub CATMain()
On Error Resume Next
Dim partDoc1 As PartDocument
Set partDoc1 = CATIA.ActiveDocument
If Err.Number <> 0 Then
MsgBox “Active document is not a part document!“”
End
End If
Dim body1 As Body
Set body1 = partDoc1.Part.Bodies.Item(1)
Dim shapes1 As Shapes
Set shapes1 = body1.Shapes
shapecount = shapes1.count
Dim shape1 As Shape
Dim sketchShape As SketchBasedShape
Dim count1 As Integer
count1 = 0
For i = 1 To shapecount
Set sketchShape = shapes1.Item(i)
If Err.Number = 0 Then
count1 = count1 + 1
End If
Err.Clear
Next
MsgBox “Number of sketch based shapes is: ” & count1
End Sub
I founded this macro who Count sketch based Features, but i dont know how to Count Points, any help
thx
Sub CATMain()
On Error Resume Next
Dim partDoc1 As PartDocument
Set partDoc1 = CATIA.ActiveDocument
If Err.Number <> 0 Then
MsgBox “Active document is not a part document!“”
End
End If
Dim body1 As Body
Set body1 = partDoc1.Part.Bodies.Item(1)
Dim shapes1 As Shapes
Set shapes1 = body1.Shapes
shapecount = shapes1.count
Dim shape1 As Shape
Dim sketchShape As SketchBasedShape
Dim count1 As Integer
count1 = 0
For i = 1 To shapecount
Set sketchShape = shapes1.Item(i)
If Err.Number = 0 Then
count1 = count1 + 1
End If
Err.Clear
Next
MsgBox “Number of sketch based shapes is: ” & count1
End Sub