Body name from selection
Body name from selection
(OP)
I have a real question for the CAA programers out there.
I have a selection from wich I return the selected element. I cannot find a way of returning the name of the body that aggregates the selection. I can get into the Brep and hack out the name of the object that was selected, but no way of getting the the Body (Hybrid Body).
Any help would be really apreicated
Matthew Lacroix
I have a selection from wich I return the selected element. I cannot find a way of returning the name of the body that aggregates the selection. I can get into the Brep and hack out the name of the object that was selected, but no way of getting the the Body (Hybrid Body).
Any help would be really apreicated
Matthew Lacroix





RE: Body name from selection
Sub CATMain()
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim oSel As Selection
Set oSel = partDocument1.Selection
Dim oObject As AnyObject
Set oObject = oSel.Item(1)
Dim tOPENBODY As String
tOPENBODY = oObject.Value.Parent.Parent.Name
MsgBox oObject.Value.Name & " is in " & tOPENBODY
End Sub
its VBA but it might help ;)
Eric N.
catiav5@softhome.net