ANSYS Mechanical Embedded API - Vector Principal Stress Coordinate System Creation

1980c3
1980c3 Member Posts: 3
First Comment
**

Folks,
I have a vector principal stress direction scoped to a single node within a solution combination result.

Is it possible to automate the creation of the aligned coordinate system?

Thanks,

Stu

P.S. What is the best way to hone my ANSYS API programming skills? I know it predominately IronPython. If I studied IronPython, would that be helpful?

Best Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 319
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited July 2023 Answer ✓

    Most items in the context menu that appear after a right-click in the UI can be found in the context_menu module. The methods in this module general take ExtAPI as an argument. In your case:

    VP1.Activate()
    ExtAPI.SelectionManager.NewSelection(VP1.Location) ## recommend checking that VP1 is scoped to 1 node
    import context_menu
    context_menu.DoCreateAlignedCoordinateSystem(ExtAPI)

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 319
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓

    What is the best method for accomplishing the activation of the node of interest (so that the aligned csys is scoped to the node)?

    ExtAPI.SelectionManager.NewSelection(VP1.Location)
    

    You might also want to activate the vector principal stress result object in the tree:

    VP1.Activate()

    What is the best way to hone my ANSYS API programming skills? I know it predominately IronPython. If I studied IronPython, would that be helpful?

    I would suggest the 'Introduction to Python' and 'Ansys Mechanical Scripting' courses in the Ansys Learning Hub (ALH):
    https://jam8.sapjam.com/groups/TRNfdrj7rnvfSWo2VAVxt2/overview_page/WszKQm9S3J7FYnt6bOn5Tt

    If you don't have subscription to the ALH, some of the materials are also available for free on the Ansys Innovation Space (AIS):
    https://courses.ansys.com/index.php/python/

Answers

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 183
    100 Comments 5 Answers First Anniversary Ansys Employee
    admin

    @AKD-Scripting-Team - can one of you help out here?

  • 1980c3
    1980c3 Member Posts: 3
    First Comment
    **

    Thanks Landon.


    What is the best method for accomplishing the activation of the node of interest (so that the aligned csys is scoped to the node)?

  • 1980c3
    1980c3 Member Posts: 3
    First Comment
    **

    Thanks Landon! That did the trick.