Rename all the entities in a model using TCL script.

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hello Friends,

 

I want to rename all the entities in a model with some prefix. 

 

For example:

Component Name: 51002134 to New Name: PSHELL_51002134

 

Can anyone please provide me a TCL script to do it.

 

 

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hello Friends,

     

    I want to rename all the entities in a model with some prefix. 

     

    For example:

    Component Name: 51002134 to New Name: PSHELL_51002134

     

    Can anyone please provide me a TCL script to do it.

     

    Hello Friends,

     

    I want to rename all the entities in a model with some prefix. 

     

    For example:

    Component Name: 51002134 to New Name: PSHELL_51002134

     

    Can anyone please provide me a TCL script to do it.

     

    Hi,

    if you are using nastran or optistruct, try exporting model without 'HM comments' then import it again

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Try this code:


    *createmarkpanel comps 1 'Select Component to Rename'
    set my_comps [hm_getmark comps 1]

    foreach c $my_comps {
    set name [hm_getentityvalue comps $c name 1]
    set new_name [format 'PSHELL_%s' $name]
    eval *renamecollector components '$name' '$new_name'
    }

    *clearmark comps 1