Create a selection of all Bodies in Mechanical

Member, Moderator, Employee Posts: 479
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭

Create a selection of all Bodies in Mechanical

Comments

  • Member, Moderator, Employee Posts: 479
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    1. all_bodies = []
    2. for assembly in ExtAPI.DataModel.GeoData.Assemblies:
    3. for part in assembly.Parts:
    4. for body in part.Bodies:
    5. all_bodies.append(body.Id)
    6.  
    7. sel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    8. sel.Ids = all_bodies

Welcome!

It looks like you're new here. Sign in or register to get started.