TCL Force and SPC on local system
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 /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
(Because I've never learnt how to program in TCL)
Thanks in advance,
Best regards,
Hervé
Answers
-
Under HW 14, there's an undocumented command '*loadcreatewithsystemonentity_curve'
0 -
Altair Forum User 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 ?
0 -
Nobody can help me about this topic ?
0 -
Hi, actually I am not patient enough to read the script in order to modify it.
If you can clarify your inquires, I may rewrite a sample script /emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
0 -
Waouh ! Thank you very much Tinh ! I cross my fingers and hope that you will have time to help me /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
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,
Hervé
0 -
Another possibility: By knowing local systems, on can compute yourself the projections of loads on global system and apply to nodes within your TCL script.
0 -
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.
0 -
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):
<?xml version="1.0" encoding="UTF-8"?>
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 ? /emoticons/default_sad.png' srcset='/emoticons/sad@2x.png 2x' title=':(' width='20' />
Kind regards,
Hervé
0 -
Just write a small proc to extract ID-system from TXT file.
Why use such complicated format in your TXT file?
0 -
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 /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
Regarding your answer :
Altair Forum User 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.
0 -
But without neither your TCL script nor your TXT files, how could I help you?
0 -
For example by explaining me how to extract ID-system. What is the syntax to do it ? And where to write it in the program...
0 -
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... /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
Good luck!
0