CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ICEM] Hotkeys commands via script files? (https://www.cfd-online.com/Forums/ansys-meshing/105317-hotkeys-commands-via-script-files.html)

macfly July 27, 2012 10:33

Hotkeys commands via script files?
 
Dear users,

Is there a way to call a hotkey command from a script file? For example, "Shift-i" from a script file in order to modify view to isometric.

I'm just beginning with scripting, sorry if it's a basic question!

François

PSYMN July 28, 2012 08:18

A hotkey its self is just running a small script in the background... So you would just run whatever command the hotkey was going to run.

That said, it is rare that anyone would want to script something that affects the view... Still, I think the command to rotate the view would be something like you see in this script... Unfortunately, because it is a display command, it is not documented in the programmers guide. I played with it a bit and couldn't figure it out (don't have time this morning) but you can play with this script and work it out for yourself. Please post the result if you do sort it out.

Quote:

global tdv_current_viewer
set rotate_angleX 1
set rotate_angleY 2
set turns 5

set angleX [expr ($rotate_angleX * 3.14159) / 180]
set angleY [expr ($rotate_angleY * 3.14159) / 180]

for {set cur_angle 0} {$cur_angle < [expr 360 * $turns]} {set cur_angle [expr $cur_angle + $rotate_angleX]} {
tdv_rotate_axis $tdv_current_viewer 0 1 0 $angleY
#tdv_rotate_axis $tdv_current_viewer 1 0 0 $angleX
tdv_trans_update $tdv_current_viewer
update
}


All times are GMT -4. The time now is 15:26.