Jump to content

TCL Force and SPC on local system

Recommended Posts

Hello Everyone !


I would like to set up a problem on Hypermesh which include around a hundred load cases (in linear static).

To automate it, I found a TCL which "allows a simple template to be created to define the loadcases; useful for creating large numbers of static loadcases very quickly and easily" (link)

Thanks to a little VBA, I've just succeed in transforming my Excel data base into a readable txt file for this TCL script. And it works.


But my problem is this TCL script only applies my forces (and SPC) on the global system.

Is there a solution, and how can modify the TCL script so that it can apply my load cases on a specific local system (expressed into the .txt for each load cases) ?


If someone can help me to takle this problem, I will be sooo grateful :)

(Because I've never learnt how to program in TCL)


Thanks in advance,

Best regards,





Share this post

Link to post
Share on other sites
16 hours ago, Q.Nguyen-Dai said:

Under HW 14, there's an undocumented command "*loadcreatewithsystemonentity_curve"


Thanks Q.Nguyen-Dai !

Do you know how can I use it into this TCL program ?

Share this post

Link to post
Share on other sites

Waouh ! Thank you very much Tinh ! I cross my fingers and hope that you will have time to help me :)


So in a nutshell, I would like to import Excel data (load and boundaries (SPC)) into Hypermesh so that I can set up a stress analysis (with 120 load cases).

Some of this SPC and FORCE are expressed according to specific local systems.

The script previously cited works for me but it imports all my data only on the global system and it's not fine for this case (especially for the components of forces).


Thanks again,

Have a nice day,



Share this post

Link to post
Share on other sites

Yeah it's a good idea but I didn't select it to facilitate later steps in the project (to keep the same data from beginning to end).

But if I don't solve it, I will have to use this solution.

Share this post

Link to post
Share on other sites

To keep you informed, I furthered the subject by testing the command "*loadcreatewithsystemonentity_curve" that Q.Nguyen-Dai gave to me 4 weeks ago.

Now the result is quite good since loads can be expressed in the proper local system and not in the global one.

But because I've never learnt how to program in TCL, I have still some troubles with the automation.


Initial code (create_loadcases.tcl):



I changed the line 757 with the command previously quoted.

The argument underlined in red is dedicated to the system's ID where my forces will be expressed.


With this syntax hereinabove, all my forces will be created in the "152 Local System".

Now, I try to automate this new infomation like the components of my Force ($FX $FY $FZ) so that data can  be collected automatically from the input .txt file.



Initial txt example file (from "example1" folder) :



Modification: System's ID information:



But from now, it doesn't work because some lines have to be added to extract the informations from the txt file and to add it to my " $id_system "

Can someone help me to implement this modification ? :(


Kind regards,



Share this post

Link to post
Share on other sites

Because I found this script that can help me to set up more than 100 load cases easily...

But if you have a better proposition or idea, I'm ready :)

Regarding your answer :

6 minutes ago, Q.Nguyen-Dai said:

Just write a small proc to extract ID-system from TXT file.


I don't really understand it... Will it be possible to help me a little bit more ? Or even better to modify quickly the program to implement this "action" ?


Thanks for your help.

Share this post

Link to post
Share on other sites

Ahhh, I understand now. You got script from someone and you don't know how to customize.

If you want to modify structure of config file, you have to adapt TCL too. So if "FORCE" card is modified, go to "includes\create_loadcases.tcl" and look for the line


proc ::CreateLoadcase::ReadConfigFile { ConfigFile } {

Within this proc, you have to modify the code for "FORCE" card:

			} elseif { $Card == "FORCE" } {
				set NodeName [ string trim [ lindex $Data 1 ] ]
				set Factor [ string trim [ lindex $Data 2 ] ] 
				set ForceData [ string trim [ lindex $Data 3 ] ]
				set LoadGroup [ string trim [ lindex $Data 4 ] ]
				set FX [ string trim [ lindex $ForceData 0 ] ] 
				set FY [ string trim [ lindex $ForceData 1 ] ] 
				set FZ [ string trim [ lindex $ForceData 2 ] ] 
				lappend FORCE($Index) "{ $NodeName } { $Factor $FX $FY $FZ 1 } { $LoadGroup }"
			} elseif { $Card == "MOMENT" } {

At the end of this script, you have to insert added data into list to return.

And so on... :)

Good luck!

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

  • Create New...