×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Body name from selection

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

RE: Body name from selection

in another forum i wrote :

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources