Page 1 of 1

Incremetal rotation

Posted: Sun Mar 15, 2020 4:15 pm
by vpapanik
Is it possible to write a macro that performs a rotation increment of the current by a specific axis and angle ?

Re: Incremetal rotation

Posted: Thu Apr 09, 2020 7:42 pm
by escolano
Off course you can write a Tcl proc invoked from a macro button.
What do you want?
a) modify the geometry or mesh coordinates by rotation
b) do not modify coordinates, rotate only the view

To do a) you can basically do the same as the Utilities->Move... window
(do the operation as user and open the Undo window to see the 'GiD process' words done)
In your tcl proc you can use the special Tcl command GiD_Process to send your words to GiD to be processed.

to do b) use some View->Rotate... tool and the same, identify the GiD process keywords to do something similar in your Tcl proc.

Re: Incremetal rotation

Posted: Fri Apr 10, 2020 8:27 am
by vpapanik
View rotation only.
I did that using several different scripts and buttons for different angles.

What I was looking for is to somehow to write/read the current state of rotation and apply only a positive/negative increment with just two buttons.

Re: Incremetal rotation

Posted: Fri Apr 10, 2020 10:50 am
by escolano
There is a Rotate ScreenAxesIncrement process command, to rotate an increment or angle around axes x y or z

e.g to rotate around z axis:
GiD_Process 'Rotate ScreenAxesIncrement z $angle_degrees

Usually the rotation center is dinamically set by GiD (Utilities->Preferences - Graphical->Appearance: "Automatic rotation center" checkbox)

you can also set it to a value with

GiD_Process 'Rotate Center $x,$y,$z

but off course with 'automatic rotation center' it will be recalculated when changing the view

For more advanced programming features, it is possible to use most OpenGL commands from Tcl with
GiD_OpenGL
But this is much more complicated to do. There are lot of OpenGL books to learn it.

Re: Incremetal rotation

Posted: Fri Apr 10, 2020 5:59 pm
by vpapanik
This is more than enough, thanks a very lot again !!!