BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.
SOLVED!

Request(?) opening geometry

DNU
Contributor

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 - 27
WIN 10
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
Legend

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 | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«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 - 27
WIN 10
GDL
Learn and get certified!

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!