Jump to content
Gopi T

How to create component/properties using TCL script?

Recommended Posts

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?

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
On 11/27/2018 at 6:00 PM, tinh 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,

Share this post


Link to post
Share on other sites

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

 

vipin likes this

Share this post


Link to post
Share on other sites
16 hours ago, Livil Lyle 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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...