PrasannaNX
Automotive
- Aug 5, 2014
- 31
Hi,
Could someone please guide me in creating a macro where i need to find all faces from a shape object through Catia APIs?
Below is the code where i am looping part document/bodies and initializing shape object from each body.
Here i want to get faces of each body using shape object.
Assume i have 3 part bodies with one pad shape in each.
If there is a different approach to find faces of a specific shape object, also please do mention.
Could someone please guide me in creating a macro where i need to find all faces from a shape object through Catia APIs?
Below is the code where i am looping part document/bodies and initializing shape object from each body.
Here i want to get faces of each body using shape object.
Assume i have 3 part bodies with one pad shape in each.
If there is a different approach to find faces of a specific shape object, also please do mention.
Code:
Sub Main()
Dim catApp As Application
Dim catPartDoc As PartDocument
Dim catPart As Part
Dim catBodies As Bodies
Dim catBdy As Body
Dim catShp As Shape
catApp = GetObject(, "CATIA.Application")
catPartDoc = catApp.ActiveDocument
catPart = catPartDoc.Part
catBodies = catPart.Bodies
For Each catBdy In catBodies
For index = 1 To catBdy.Shapes.Count
If (catBdy.Shapes.Item(index) IsNot Nothing) Then
catShp = catBdy.Shapes.Item(index)
End If
Next
Next
End Sub