Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Knowing if a story is empty?

Tomer1
Newcomer
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

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

View solution in original post

4 REPLIES 4

mikas
Advocate
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.5.1 • HP Z440 E5-1650v3/256GB/RVII/W10Pro

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

Tomer1
Newcomer
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

View solution in original post

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!