Jump to content

Recommended Posts

Hey guys,


I want to create several materials, properties and components automatically.

The desired IDs of all the materials, properties and components are saved in an external file and then written into a variable. Each of these values should create an own material, an own property and an own component. 

For creating the first material, everything works fine. But when the second material should be created, an error is occurring.

Do you have an idea how this problem can be fixed?


Kind regards



Attached, you can find the file with the IDs (these are the values in column 1 saved into the variable "field1") and the .tcl-script I'm talking about.





Share this post

Link to post
Share on other sites

below code  should work. 


# Erstellen des Materials                
*createentity mats cardimage=MAT1 name=material1;
set matid [hm_latestentityid mats]
*setvalue mats id=$matid name="$field1"; #E Value
*setvalue mats id=$matid STATUS=1 1=$field2
*setvalue mats id=$matid STATUS=1 3=0.3
*setvalue mats id=$matid STATUS=1 4=7.85e-009
*createmark materials 1 "$field1"
*renumbersolverid materials 1 $field1 1 0 0 0 0 0


*createentity props cardimage=PSHELL name=property1;
set propid [hm_latestentityid props]

*setvalue props id=$propid name=$field1
*createmark properties 1 "$field1"
*renumbersolverid properties 1 $field1 1 0 0 0 0 0
*setvalue props id=$propid materialid={mats $field1}


# Zuweisen zum Element mit der ID
*createentity comps name=component1;
set compsid [hm_latestentityid comps]
*setvalue comps id=$compsid name="$field1"
*setvalue comps id=$compsid id={comps $field1}
*setvalue comps id=$field1 propertyid=$propid

Bachelor22 likes this

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.

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.

Sign in to follow this  

  • Create New...