GDL
About building parametric objects with GDL.
SOLVED!

Parameter Dynamic Array Question.

Anonymous
Not applicable
Hi everyone,
I need to create a dynamic array for angle parameters to assign to Graphical Editing Hotspot.
As attachment image, I created an array for number of the rebars I need but when I moved hotspot, all of them is moved because I do not know how to create a dynamic array for "angle_2" parameter. I want to move each of the rebar separately.
Please show me how to do it and write onto which script window for dynamic array parameters.

P/S: When I can move each of rebar separately, then I want to know distance between selectd rebar's hotspot to both of next rebars for confirm. I thought can calculate the distance of to [i-1] and [i+1] elements. Then I will show them as displayParam in Graphical Editing Hotspot.
	angle=0
	for i=1 to iRebar_num-1
		angle=i*360/iRebar_num
		rot2 angle
			hotspot2 0, 0, unID, angle_2, 6 : unID=unID+1
			hotspot2 mRebarDis,0,unID,angle_2,4+128 : unID=unID+1
			hotspot2 (mRebarDis*cos(angle_2)),(mRebarDis*sin(angle_2)),unID,angle_2,5 : unID=unID+1
				add2	(mRebarDis*cos(angle_2)),(mRebarDis*sin(angle_2))
					poly2_b	2, 1+2+4+64, gs_fill_pen, gs_back_pen,
							0, 0, 901,
							rKei/2, 360, 4001
		del 2
	next i
Best regards,
Thanks so much.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
runxel
Legend
Hey there 🙂

Try this one.
Basically the idea is to store the rotation offset from the current point into an array.
Good luck!
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

3 REPLIES 3
Solution
runxel
Legend
Hey there 🙂

Try this one.
Basically the idea is to store the rotation offset from the current point into an array.
Good luck!
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Anonymous
Not applicable
Hi Runxel,

I knew you as GDL-Sublime's developer, it is great idea and amazing tool.

P/S: Private question, do you know or can make an ArchiCAD API Add-on?

Thank you so much.
Best regards,
Anonymous
Not applicable
runxel wrote:
Hey there

Try this one.
Basically the idea is to store the rotation offset from the current point into an array.
Good luck!
Thank Lucas so much.
It worked well and this is exactly what I want to learn. Detailed explaining from Pro with kind. I am very happy to learn something from you about GDL or API (if you doing).
I am trying to learn how to write GDL more easier from GDL-Sublime of yours via XML workflow.

Thank again.
Best regards.
HAI