We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.
SOLVED!

Cannot figure out how to get wall radius for label

Podolsky
Ace
I need to script a label, that would know radius (also coordinates of radius centre) of the wall. I looked how window knows about it - for that there is special global variable WIDO_ORIG_DIST. But wall's global variables do not have any information about it. Any ideas? Or it's just impossible?
21 REPLIES 21
Podolsky
Ace
I cannot comment this anymore.
Solution
Anonymous
Not applicable
Looks like AC25 has the solution.
New label parameter: LABEL_ASSOC_ELEM_GEOMETRY

radius_of_circle = Arc Length/Subtended Angle in Radians
r = s/θ

Does this now makes sense?
Podolsky
Ace
Now it does. I was writing on ArchiCAD 21, so didn't know about this new variable. It's actually introduced in ArchiCAD 23. Thank you a lot - this very useful information.
Anonymous
Not applicable
You are welcome Podolsky.
Aaron Bourgoin
Virtuoso
Podiolsky. I sense beer is coming your way soon. I've introduced your label to a couple of teams in the office to try. I really appreciate your efforts as well as Braza's! Thank you.
Think Like a Spec Writer
AC4.55 through 27 / USA AC27-6000 USA
Rhino 8 Mac
MacOS 14.6.1
Podolsky
Ace
Million of thanks. Soon I will include curve part too, as you can see - we figure it out how to make it.
Please let me know, do you need support for sections, or sections are not relevant.
Aaron Bourgoin
Virtuoso
Hey Podolsky. Sections are less important. Plan cover the mandatory base information we need to submit. But thanks for asking.
Think Like a Spec Writer
AC4.55 through 27 / USA AC27-6000 USA
Rhino 8 Mac
MacOS 14.6.1
Anonymous
Not applicable
Hey Aaron,
I am glad my small contribution to Podolsky label could somehow help.
It looks like a proper Fire Rating Label is coming to reality.
Cheers,
Podolsky
Ace
Yes, I think to keep a label as it is for old ArchiCAD versions, but add ArchiCAD version check, that, if version is 23 and above - to use modified script with a new global. So the object itself then still available starting from AC 21.
Dominic Wyss
Booster
Here's my quick & dirty solution for wall radius:
dict geo, p

if haskey(LABEL_ASSOC_ELEM_GEOMETRY.referenceLine2D.contour.edges[1].ArcAngle) then
	geo.has = "yes"
	geo.ang = LABEL_ASSOC_ELEM_GEOMETRY.referenceLine2D.contour.edges[1].ArcAngle
	geo.num = vardim1(LABEL_ASSOC_ELEM_GEOMETRY.referenceLine2D.contour.edges)

	p = LABEL_ASSOC_ELEM_GEOMETRY.referenceLine2D.contour
	geo.dir.x = p.edges[2].begPoint.x - p.edges[1].begPoint.x
	geo.dir.y = p.edges[2].begPoint.y - p.edges[1].begPoint.y

	geo.chord = (geo.dir.x^2 + geo.dir.y^2)^0.5
	geo.rad = geo.chord/(2*sin(geo.ang/2))


else
	geo.has = "no"
	geo.ang = 0
	geo.num = 0
	geo.rad = 0

endif


hotspot2 0,0

if geo.num > 2 then
	text2 0,0, "poly"

else
	text2 0,0, "ang= " + str("%", geo.ang) + "\nrad= " + str("%", geo.rad)

endif
works for AC23 and younger
AC27 CHE - macOS Ventura M1