GDL
About building parametric objects with GDL.

Can you create a Label GDL that can sum?

LeeJaeYoung
Virtuoso

Can you create a Label GDL that can sum?

Even if there is a hole at the bottom, it is one fill, so you can get the area with an area label, but the top two fills cannot be made with one fill. (In Autocad, it is possible to hatch as one even if it is separated)
But I need to create a Label that represents the sum of the two.

Is this possible in Archicad?

LeeJaeYoung_0-1668676925284.png

 

 

AC27 on window 11
14 REPLIES 14
julienK
Advocate

You can do that  with an  addon but I don't think GDL is able to

Is it possible with API?
It seems that the sum of the two fills can be expressed as text.
Isn't it possible to link with more than one object like label?

AC27 on window 11

the API will let you create a text or label with the sum area of whatever you want.

Labels can only  be linked to one element as far as i know.

What I'm curious about is the Label made with the API you mentioned.
Are you saying that if only one element can be connected, you can create a label that is connected to two or more elements?
I would appreciate it if you could tell me which of the api sample files to study or which function to use if the label made with the api is linked to more than two elements.
Thank you for your interest. ^^

AC27 on window 11

The, API won't let you link multiple elements to a label.

If you look at the notification manager exemple in the API it has a file called Element_Observer.cpp, in that file there is a function Do_ClickedElementMonitor(bool)

The way it works is, you attach elements, fills in your case to the observer.

When those elements are changed it sends a notification. You can then use this notification to modifiy a label, or a text with the sum area of the fills you are observing.

Look at these functions in the APIdocumentation:

ACAPI_Notify_InstallElementObserver

ACAPI_Element_AttachObserver

ACAPI_Element_DetachObserver

Thank you so much ^^

AC27 on window 11
Mathias Jonathan
Advocate

I had this problem: I wanted to have the sum of the surface area of the flats of my project on my plan.

 

We resolved this kind of problem with the help of Poco and a Python script:

The script sums all the areas and put the result in a property in each zone.

We just have to retrieve the result with a label displaying the property showing the result.

May I ask for a more understandable explanation?
And can you tell me what should I study?

AC27 on window 11

Capture d’écran 2022-11-18 à 13.59.39.png