Archicad C++ API
About Archicad add-on development using the C++ API.

Knowing if a story is empty?

Anonymous
Not applicable
Hello,

I want to know if a specific floor has anything in it.
In other words, a function which gives the number of elements (of any kind) in a specific floor would be a great solution for me.

Thanks
1 ACCEPTED SOLUTION
4 REPLIES 4
mikas
Expert
Ok, this was in a developer forum, so maybe I answered for a very different thing you wanted to know of.

All layers open. Check renovation filter to show all stages of it.
Select arrow tool. Select everything (ctrl/cmd+A)
Modify Selected (ctrl/cmd+option+T)

A dialog will show you all (selected) elements by type and count.
AC25, Rhino6/7+Grasshopper, TwinMotionMac Pro 6,1 E5-1650v2-3,5GHz/128GB/eGPU:6800XT/11.6.5 • HP Z4/Xeon W-2195/256GB/RX6800XT/W10ProWS
Ralph Wessel
Mentor
You could call ACAPI_Element_GetElemList with the API_ElemFilterFlags parameter set to APIFilt_OnActFloor. That will extract a list of elements on the active floor - it empty, you know there aren't any.
Ralph Wessel BArch
Anonymous
Not applicable
Ralph wrote:
You could call ACAPI_Element_GetElemList with the API_ElemFilterFlags parameter set to APIFilt_OnActFloor. That will extract a list of elements on the active floor - it empty, you know there aren't any.
that’s an option, but I don’t want to change the active floor every time. My goal is to make this check for every floor and then delete the layouts of floors without elements in it.
Solution
Ralph Wessel
Mentor
You can restore the active floor after cycling through them all.

I think the only other alternative is iterating through all the elements and checking which floor they're on. You can use ACAPI_Element_GetHeader to avoid loading the whole element.
Ralph Wessel BArch

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!