Find more posts tagged with
Hi Pritish,
It will be idea for you to create GUI using TK. You can refer to HW GUI Toolkit
1. From the Start menu, select All Programs.
2. Select Altair HyperWorks.
3. Select Tools.
4. Select HW GUI Toolkit.
You can also refer to the userguide to get started:
https://connect.altair.com/CP/kb-view.html?jf=112968&f=&kb=112938
Code for importing geometry in HM is as follows:
set filepath [tk_getOpenFile]set tolerance [hm_getfloat tolerance input]
set scalefactor [hm_getfloat scalefactor input]
*geomimport 'auto_detect' '$filepath' 'CleanupTol=$tolerance' 'DoNotMergeEdges=off' 'ImportBlanked=off' 'ScaleFactor=$scalefactor'
How can I get these inputs like CAD location, tolerance, scalefactor from user when I run TCL script ?
Hello Guys,
Hope you are all doing well ! Your tutoring has helped me a lot in my initial coding.
Now, I am looking to load a tpl file, but before loading I want to take user input for one variable (say span) and use that variable value in formules mentioned in tpl script.
For that I am thinking to have a window pop up before running tpl file, which will store user input value(span) in one variable ($input) and then using this $input in further tpl script.
I was able to write this code for poping up window in hypermesh, but this is not working in hyperview when I call same tcl script.
set input [hwtk::inputdialog -text 'Enter Span Value' -inputtype str \
-x [winfo rootx $w] -y [winfo rooty $w]]
tk_messageBox -title 'hwtk::inputdialog' -message 'Span: $input mm'
1. CAN you guys help me to pop up a window in Hyperview which will store data in a variable ?
2. How to integrate Tpl script in Tcl to achieve my objective ? or any other way to load the tpl file with Step 1 input in it ?
Awaiting your replies !
Tpl does not share variables with tcl
Suppose sample.tpl is your file
Add these tcl codes to dip $input in sample.tpl
set fpt [open sample.tpl]
set buf [read $fpt]
close $fpt
set buf [string map '\$input \'$input\'' $buf]
set fpt [open sample2.tpl w]
puts $fpt $buf
close $fpt
Now open the sample2.tpl
sample.tpl is reserved
Ok I will search for that
But will direct tcl commands work in hyperview script?
And it will be really helpful if you give any example script you have
And will it pop up window or where we supposed to enter values?
HI,
I am trying to get data from hyperbeam Eg. IY,IZ of a solid section. Can you please help me with script or command?
I mean a surface that fits with the section. Sorry for my english
Hi tinh,
My hypermesh model contains some Hyperbeam sections. Each section will have associated data like shown below,
Area = 777.34677330
Centroid :
Local
Yc = 0.00369492
Zc = 0.00048295
Moments Of Inertia :
Local
IY = 8385.75207149
IZ = 292739.17537076
IYZ = 0.00138714
Centroidal
Iy = 8385.75189018
Iz = 292739.16475806
Iyz = 0.00000000
Principal
Iv = 8385.75189018
Iw = 292739.16475806
Angle = 0.00000000
How can i get this data to text or any readable file by using command because my model has many such beams and I need to extract this details of all the beams.
You have to enter hyperbeam GUI first
yes tinh, its working now.. thanks a lot...
I would like to know that is there any command to switche to thyperbeam GUI.
If it works then it would be very easy to get the required data.
I am trying with *createmark beamsects 1 'solid_section.0' ,
but its not working..hb_getresults will only work if we switch to hyperbeam gui and select the particular beam section and switch back to model gui...
Hi,
please search for input box in tklib
or you can write your own, by dumping tk_dialog, and add an entry on it