Jump to content
kandiyal

Error in Tcl/Tk Macro to create multiple material

Recommended Posts

Use this code:

 

variable  templatefilename [hm_info templatefilename];

proc createMat {name E G Nu RHO id} \
{    
    variable templatefilename
    *collectorcreate materials "$name" "" 35
    *createmark materials 1 "$name"
    *dictionaryload materials 1 "$templatefilename" "MAT1"
    *attributeupdateint materials $id 3240 1 2 0 1
    *attributeupdatedouble materials $id 1 1 0 0 $E
    *attributeupdatedouble materials $id 2 1 0 0 $G
    *attributeupdatedouble materials $id 3 1 0 0 $Nu
    *attributeupdatedouble materials $id 4 1 0 0 $RHO
    *clearmark materials 1;

}

createMat Steel 54000 72000 0.36 0.0000000065 1;
createMat "Al 2024" 72000 80769.2 0.33 0.00000000785 2;
createMat "Al 6065" 54000 72000.2 0.36 0.0000000065 3;
createMat "ttl" 34000 71000.2 0.37 0.0000000067 4;

kandiyal 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.

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...