Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

GDL
About building parametric objects with GDL.
SOLVED!

Request(?) opening geometry

DNU
Booster

Hi

 

I'm creating a label that shows the dimensions of an opening (created with the opening tool). This works fine for rectangular opening (width + height). But for circular openings the diameter must be shown (or just width).
Is there a way to find out what the shape of the opening is in a label?

 

For now i'm using a boolean in the label properties, I hope I can do it automaticly.

DNU_0-1704901370854.png

AC 14 - 28
WIN 11
GDL
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
easyDoesIt
Booster

A workaround is to test the area and perimeter. The only downside in the unlikely event a polygon opening could have the same perimeter as a circle with the same overall width and height. But unlikely the case.

 

 

eps = 0.0001

	!if a opening
if GLOB_ELEM_TYPE = 26 then
	n = REQUEST ( "Property_Value_Of_Parent", "Builtin.General_Area", type, dim1, dim2, elementArea)
	n = REQUEST ( "Property_Value_Of_Parent", "Builtin.General_3DPerimeter", type, dim1, dim2, elementPerimeter)

		!if length x width is the correct area, then a rectangle
	if abs( (opening_width * opening_height) - elementArea) < eps then
		text2 0, -1, "rectangle " + str(opening_width,4,3) + " x " + str(opening_height,4,3)
	else
			!if circle then diameter should match
		if abs ( (2 * PI * (opening_width/2)) - elementPerimeter ) < eps then
			text2 0, -1, "circle diameter " + str(opening_width,4,3)
		else
			text2 0, -1, "polygon " + str(opening_width,4,3) + " x " + str(opening_height,4,3)
		endif
	endif
endif

 

 

Cheers,
Mark
Brisbane, Australia

View solution in original post

3 REPLIES 3
runxel
Hero

There seems to be no way, sadly. The "OPENING_SYMBOL_GEOMETRY" dict is not accessible from a label, so I don't know how to deduce it otherwise.

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»
Solution
easyDoesIt
Booster

A workaround is to test the area and perimeter. The only downside in the unlikely event a polygon opening could have the same perimeter as a circle with the same overall width and height. But unlikely the case.

 

 

eps = 0.0001

	!if a opening
if GLOB_ELEM_TYPE = 26 then
	n = REQUEST ( "Property_Value_Of_Parent", "Builtin.General_Area", type, dim1, dim2, elementArea)
	n = REQUEST ( "Property_Value_Of_Parent", "Builtin.General_3DPerimeter", type, dim1, dim2, elementPerimeter)

		!if length x width is the correct area, then a rectangle
	if abs( (opening_width * opening_height) - elementArea) < eps then
		text2 0, -1, "rectangle " + str(opening_width,4,3) + " x " + str(opening_height,4,3)
	else
			!if circle then diameter should match
		if abs ( (2 * PI * (opening_width/2)) - elementPerimeter ) < eps then
			text2 0, -1, "circle diameter " + str(opening_width,4,3)
		else
			text2 0, -1, "polygon " + str(opening_width,4,3) + " x " + str(opening_height,4,3)
		endif
	endif
endif

 

 

Cheers,
Mark
Brisbane, Australia

Thanks Mark!

 

This works perfect!

 

gr

Dries

AC 14 - 28
WIN 11
GDL

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!