Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Rotating a componenet within an object

Anonymous
Not applicable
I would like to make a GDL Object using two Morphs. I would like to make one of the components rotate around an A-symmetrical point within the library part. I tried to figure it out using the GDL Guide but it was confusing and I am not sure where to find the answer. I know how to do the “Rotx,y,z” parameters but would like to be able to do it with only a portion of the object. Simplified (Imagine a lever arm 2/3 on one side of the fulcrum and 1/3 on the other the fulcrum is a triangle. How can I make the library part so that it rotates the lever arm around the point I want it to be so that I can insert an angle into a parameter and only pivot the lever arm?

I have made a simplified trial GDL Object to figure it out. Once I can do it on this I will apply what I have learned to the more complicated Object I want to modify.
6 REPLIES 6
Barry Kelly
Moderator
First thing is rotation will occure around your local origin.
So you can ADD x,y,z to move to your rotation point.
then add the script for the bit of the object you want to rotate.
Now DEL to stop the rotation
Dell again to go back to your global origin.

So you should end up with something like this.

main object script
ADD x, y, z (to move to rotation point)
ROT x, y, z (to rotate around local origin)
script for rotating element
DEL 1 (to stop rotation)
DEL 1 (to move back to global origin)


Remember if you split the ROT x, y, z into separate ROT x, ROTvy, ROTvz commands then you will need a separate DEL for each one.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
This was helpful. It is a bit tricky how to order the descriptors for the objects as it seems to keep the rotation parameter for the remainder of the script. When I tried to add additional Del to the script the check script function triggered an error.
Anonymous
Not applicable
The issue with using a mesh is that it has its own origin. Is there any way to adjust the rotation point separately from adjusting where the insertion point of the mesh is.

Or is there a way in the mesh tool to define where the origin point will be.
Anonymous
Not applicable
So I figured it out my self. When I create the object from the Mesh the location of the project Origin is the Object origin. So if I place the zero coordinate correctly I do not need to translate the X,Y,Z after.

Thank you for the help
Barry Kelly
Moderator
A good rule of thumb is when ever you are saving model elements as an object then model them (or move them) to the drawing origin before saving as an object.
Place the point you want as the object origin on the project origin.

In the first few lines of an object created by saving elements will be MUL and ADD.
The MUL is rescaling everything in the script after it based on the A, B and ZZYZX sizes in your parameters
The ADD will be moving everything in the script after it to absolute 0,0,0 - i.e. negating the offset of the elements from the project origin.

Any ROT, ADD, MUL (transformation commands) that you add needs to be before these other commands.

I have noticed that the automated scripts do not always (never?) put the appropriate DEL commands at the end to negate the initial ADD and MUL commands.
Out of habit I always add these myself.
THE DEL commands required for the ADD command you place at the beginning of the script must come after the last DEL commands.

Keep the automated script intact as if it is in a bubble.
Only add commands before and after this script until you really know what you are doing.
Many lines in the automated scripts can be deleted with no harm but it is best just to ignore them.

The simple version of the DEL command will always undo the most recent transformation command in the script - a bit like closing brackets in a mathematical equation.
That is why it is important to have a matching DEL for every transformation command

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
Thank you this is helpful. I was able to figure some of this out on my own. After some trial and error I finally got the object to behave the way I wanted it to and now it rotates nicely around the pivot point.

I work for the Zoo and we have allot of unique one off assemblies that only we use. That said we are trying to use these assemblies wherever they work. By taking the time to model these in a way that I can manipulate the function It helps me explain them in meetings with staff and consultants. There is nothing worse than 6 people sitting around for 20 minutes arguing with one another in favor of the same solution.