Can I customize "Rename based on Definition" of results in Mechanical?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 450
100 Answers 250 Likes 100 Comments First Anniversary
✭✭✭✭
edited June 2023 in Structures

Currently Mechanical application automatically renames the result or Result Tracker based on the selected parts and display time of the result object. Can I add more result object properties in the naming scheme?

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 450
    100 Answers 250 Likes 100 Comments First Anniversary
    ✭✭✭✭
    Answer ✓

    "Rename based on Definition" is a native functionality so probably customizing this is not directly possible. One can however create a very simple workaround by creating a user-button.

    1. Select all the Tree objects which have to be renamed.
    2. Hit the "Rename" user-button.

    You can access the objects and all their properties in the button (using ExtAPI.DataModel.Tree.ActiveObjects) and rename the objects based on whatever property you wish.

    Example code of the user button - where I add LoadStep number to the existing result object name.

    objects = ExtAPI.DataModel.Tree.ActiveObjects
    for index, res_object in enumerate(objects, start=1):
        res_object.Name += "LS_%s" % res_object.PropertyByName("LoadStep").InternalValue
    

    enter image description here