We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-09-24 09:34 PM
Hello all,
Recently I started investing my time in learning GDL scripting. So I apologize if my question is silly. I will probably have many of them in the future, so thank you upfront for understanding.
My first question is regarding the graphical hotspots department.
I am trying to make it so that certain spots from POLY2_B shape can be moved freely,
Also, I struggle in figuring out how to make code structure regarding the offset of the diagonal shape with the ability to have a parameter for thickness.
Cheers.
Stefan Veselinović
Solved! Go to Solution.
2022-09-25 11:55 PM
Two problems I see are:
2022-09-25 01:23 AM
you need to create a hotspot that modify the C dimension when you move it, to made this is necesary define a group of hotspot working together , Base hotspot, reference hotspot and moving hotspot , the base hotspot will be in the start of C dimension and rererence hotspot indicate de direction where the spot will move and the move hotspot will be the one you move and will be and the end of dimension C
2022-09-25 09:18 AM
Hello @Jorge_Arreguin ,
Thank you for replying.
I understand the basic concept of how hotspot works, and I already made Variable C work. What confuses me is, is there a way to create an independent code structure to move that one point independently, inside my C distance (DX1 distance as shown in the picture)?
I tried following code structure:
!LDX parameter for DX1 distance
HOTSPOT2 A, St, hsid+1, LDX, 1+128: hsid=hsid+1 !base (hidden)
HOTSPOT2 -1, St, hsid+1, LDX, 3: hsid=hsid+1 !referece
HOTSPOT2 DX1, St, hsid+1, LDX, 2: hsid=hsid+1 !moving
With this code, I am able to create a hotspot, but without luck in changing DX1 length
Cheers,
Stefan
2022-09-25 09:22 AM
Full code structure
2022-09-25 11:55 PM
Two problems I see are:
2022-09-26 10:56 PM
@Kristian Bursell Thank you very much for help,
Such a dumb thing to not notice :D.
While I have your attention, could you help me also with how to structure the code to have a diagonal shape thickness as a parameter?
Cheers,
2022-09-27 12:27 AM
Use the same hotspot definition method you have been (x direction) then simply do a "ROT2" 2d transformation to rotate the hotspot relative to the diagonal angle.
You will obviously have to do basic math to position the hotspot reference just remember you DON'T have to put these position values in the hotspot coordinates but instead can put them in the 2d transformations such as "ADD2" and "ROT2" before the hotspot code. It's just easier to read the logic this way and keeps the hotspot definition simple.
would look like this:
add2 x, y !you do the maths 😉
rot2 45
hotspot code
del 2
2022-09-27 07:18 AM
Thank you again for this advice. 🙂
Cheers 🙂