Incremetal rotation

Moderator: GiD Team

User avatar
vpapanik
Posts: 46
Joined: Sat Oct 08, 2016 1:05 pm

Incremetal rotation

Postby vpapanik » Sun Mar 15, 2020 4:15 pm

Is it possible to write a macro that performs a rotation increment of the current by a specific axis and angle ?
User avatar
escolano
Posts: 1624
Joined: Thu Sep 18, 2014 3:31 pm

Re: Incremetal rotation

Postby escolano » Thu Apr 09, 2020 7:42 pm

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.
User avatar
vpapanik
Posts: 46
Joined: Sat Oct 08, 2016 1:05 pm

Re: Incremetal rotation

Postby vpapanik » Fri Apr 10, 2020 8:27 am

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.
User avatar
escolano
Posts: 1624
Joined: Thu Sep 18, 2014 3:31 pm

Re: Incremetal rotation

Postby escolano » Fri Apr 10, 2020 10:50 am

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.
User avatar
vpapanik
Posts: 46
Joined: Sat Oct 08, 2016 1:05 pm

Re: Incremetal rotation

Postby vpapanik » Fri Apr 10, 2020 5:59 pm

This is more than enough, thanks a very lot again !!!

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 3 guests