GDL
About building parametric objects with GDL.
SOLVED!

Request the top area of this slab?

yongler
Enthusiast
I want to make GDL for floor slab accessories and request the top area of this slab. I wrote this: n = REQUEST("SLAB_TOP_SURF" , " " , _area ) But it was not successful. May I ask how to write this sentence?
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Pertti Paasky
Expert

I think the object does not get the area information of the slab, but You can calculate the area from the point information.

https://www.wikihow.com/Calculate-the-Area-of-a-Polygon  this site tells how.

- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

View solution in original post

5 REPLIES 5
Solution
Pertti Paasky
Expert

I think the object does not get the area information of the slab, but You can calculate the area from the point information.

https://www.wikihow.com/Calculate-the-Area-of-a-Polygon  this site tells how.

- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

@Pertti Paasky wrote:

I think the object does not get the area information of the slab


This is correct.

@yongler 

SLAB_TOP_SURF is not for use in REQUEST commands.

It is a Global Variable that can be used only in lists or labels - i.e. a label can give you the area of a slab.

As Pertti suggests, you will have to calculate the area from the point information (nodes) of the slab.

I am not quite sure why you would want the area for an accessory object though?

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
yongler
Enthusiast

Thank you very much! This is exactly what I want. 

!!!===求板面积,不包括挖洞的=======
data1 = 0.0
data2 = 0.0
FOR i = 1 to points -1  !!!叉乘
	 data1 =  P[i][1] * P[i+1][2] + data1
	 data2 =  P[i+1][1]* P[i][2] + data2 
 next i

slab_area = (data1 - data2 ) /2    !!!单层面积

I want to create a GDL that generates a building model from slab Accessories Add Ons and calculates the area of the building.
When changing the shape of the slab, the building outline also changes, and the area data changes accordingly. The area data is embedded in this GDL, rather than displayed through labels.

Thank you very much! This is exactly what I want. 

!!!===求板面积,不包括挖洞的=======
data1 = 0.0
data2 = 0.0
FOR i = 1 to points -1  !!!叉乘
	 data1 =  P[i][1] * P[i+1][2] + data1
	 data2 =  P[i+1][1]* P[i][2] + data2 
 next i

slab_area = (data1 - data2 ) /2    !!!单层面积

 With the calculation method, writing scripts using GDL is so simple.