How to create component/properties using TCL script?
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?
Answers
-
for {set i 5} {$i<=20} {incr i} {
*collectorcreateonly comps comp_t[expr 0.1*$i] '' 11
}
0 -
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
0 -
Please post the error here
0 -
Try doing property operations using property name instead of IDs.
0 -
0
-
Altair Forum User said:
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,
0 -
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
0 -
Altair Forum User said:
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
0