🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to create component/properties using TCL script?

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

Hello,

I am begineer to TCL scripting!

I want to create components with the name component_t0:5 to component_2.0 with 0.1 increment from 0.5 to 2.0 using for loop .

 

Can anyone help me in this?

 

Find more posts tagged with

Sort by:
1 - 8 of 81
    User: "tinh"
    Altair Community Member
    Updated by tinh

    for {set i 5} {$i<=20} {incr i} {

        *collectorcreateonly comps comp_t[expr 0.1*$i] '' 11

    }

    User: "Jeffersondhv"
    Altair Community Member
    Updated by Jeffersondhv

    When I create properties often I have some problems with the IDs. (on LS-Dyna profile)

    I get ID conflict even though the ID is unique in the model.

     

    What can I do to fix this?

     

    Thanks,

    Jefferson Vieira

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Please post the error here

    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    Try doing property operations using property name instead of IDs. 

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

     

     

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

    for {set i 5} {$i<=20} {incr i} {

        *collectorcreateonly comps comp_t[expr 0.1*$i] '' 11

    }

     

    Hello Sir,

     

    Thanks for your information.

    I have created properties using above code. But I want to update thickness value according to the pro/comp name

    Example:

    thickness_t2.1  #comp name

    thickness_t2.1. #prop name --- in this i want to update thickness according to the name i.e 2.1 and card image also(PSHELL) in the same loop.

     

    Can anyone help me in this?

    Thank you,

    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    Hi, 

     

    You can use a logic similar to below:

     set str_compname 'thickness_t2.1' set thickness [string trimleft [lindex [split $str_compname _] end] t] set str_prop [hm_getvalue comps name=$str_compname dataname=property.name] *setvalue prop name=$str_prop  95=$thickness; #95 is thickness dataname in Nastran user profile

     

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

    Hi, 

     

    You can use a logic similar to below:

      set str_compname 'thickness_t2.1' set thickness [string trimleft [lindex [split $str_compname _] end] t] set str_prop [hm_getvalue comps name=$str_compname dataname=property.name] *setvalue prop name=$str_prop  95=$thickness; #95 is thickness dataname in Nastran user profile

     

    Thank you