How Do I automate the toolbar options for convert and extend

Rajesh Meena
Rajesh Meena Moderator, Employee Posts: 85
Photogenic 5 Likes Name Dropper Ansys Employee
✭✭✭✭

I am looking for script which can Automate the manual conversion and extension of selected entities.

Best Answer

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 85
    Photogenic 5 Likes Name Dropper Ansys Employee
    ✭✭✭✭
    Answer ✓

    Extend operations:

    Till 2022R2:

    # Adjacent , DS.Script.doGraphicsAdjacentSelect()
    
    #limit, DS.Script.doGraphicsAdjacentSelectRecursive()
    
    cmds = "DS.Script.doGraphicsAdjacentSelect();"
    
    ExtAPI.Application.ScriptByName("jscript").ExecuteCommand(cmds)
    

    From 2023R1 onwards:

    import toolbar
    
    toolbar.DoGraphicsAdjacentSelect(ExtAPI)
    toolbar.DoGraphicsAdjacentSelectRecursive(ExtAPI)
    toolbar.DoGraphicsAdjacentConnectionSelectRecursive(ExtAPI)
    toolbar.DoGraphicsExtendSelectInstances(ExtAPI)
    
    
    


    For Entity Conversion:

    import toolbar
    
    toolbar.ConvertSelectionToFaces(ExtAPI)
    
    toolbar.ConvertSelectionToBodies(ExtAPI)
    
    toolbar.ConvertSelectionToEdges(ExtAPI)
    
    toolbar.ConvertSelectionToVertices(ExtAPI)
    
    toolbar.ConvertSelectionToNodes(ExtAPI)
    
    toolbar.ConvertSelectionToElements(ExtAPI)