How Do I automate the toolbar options for convert and extend

Options
Rajesh Meena
Rajesh Meena Moderator, Employee Posts: 67
First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Likes

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: 67
    First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Likes
    Answer ✓
    Options

    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)