With ACT, how can I promote contact and target faces to named selections?

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
✭✭✭✭
edited June 2023 in Structures

With ACT, how can I promote contact and target faces to named selections ?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
    500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
    ✭✭✭✭
    Answer ✓

    There is no direct ACT command to promote a contact to a named selection. However, it is possible to obtain the IDs of the contact and target faces, and create named selections based on those IDs. Below is a demo script :

        cont=ExtAPI.DataModel.Project.Model.Connections.Children[0].Children[0]
        myContactIds=cont.SourceLocation
        myTargetIds=cont.TargetLocation
        NS_Contact=ExtAPI.DataModel.Project.Model.AddNamedSelection()
        NS_Target=ExtAPI.DataModel.Project.Model.AddNamedSelection()
        NS_Contact.Name='Contact Side'
        NS_Contact.Location=myContactIds
        NS_Target.Name='Target Side'
        NS_Target.Location=myTargetIds