Elements in double in my list

Hi everyone,

I’ve some trouble with my script and I hope you may be able to help me ! :slight_smile:

I’m trying to measure the surface of all the elements (doors and windows) inside some walls.

I manage to sort my list of wall by a specific parameter and then I use the node Element.inserts to obtain all the windows and doors I need.

According to my Revit schedule, I should obtain 268 elements (223 windows and 45 doors) but I got 298 elements … Of course, my surface is therefore false.

Here is what I’ve for now :

 

Thank you ! Nathan

Any idea ? It’s probably just a small mistake …

I think collecting door and windows is the default behavior. When you set “include openings” to true you are including another category to the set. By any chance do you have openings in your facade walls?

Hi Nathan,

I would try setting Include Openings to false, because this input is designed to give you the Rectangular Openings from the walls, and you say you only want Doors and Windows.

If you check out Andreas’ Clockwork code on GitHub, you will see that Element.Inserts is just a wrapper around the API call Element.FindInserts. Then, if you check the Revit API .chm help file for Element.FindInserts, it describes the meaning of the input values.

Kind regards,

David

Thanks for your answers !

I tried to set “Include Openings” on false but it doesn’t change my value. I really just have windows and doors in my walls so it seems normal.

Anyway, I just checked the number of a certain type of windows. Dynamo found 58 occurences and my Revit found 46 occurences. I don’t understand how it’s possible.

I tried to use my script on a simple wall with one window and one door and it worked. But if I can’t be sure it works on a bigger model I can’t use it …

 

Are you using linked files or design options, maybe Dynamo and Revit sees them differently.

Or even Phases?

No, no phases and no options …

And the only linked files I used are my dwg files.

Why not get your doors and windows by categories? (with “categories” and “all element of category” nodes) nevermind i didn’t see that you were only interested in some specific walls only…

 

Why not get all doors and windows by category and then get their host (element.host from clockwork package) to create the right filter :

Hi Nathan,

Mostafa’s method sounds good.

But why are you getting these duplicates? Maybe you could zero-in on which doors and windows are causing the problem by finding the duplicates:

Kind regards,

David

Thanks you Mostafa and David !

I tried Mostafa’s method and it seems to work. I’ve made some adjustements to filter my elements by a parameter instead of a string and it’s perfect.

I still have no clue why I had these duplicates in the first place. I guess it was an issue with the “Element.inserts” node. Anyway, it’s working now, thanks !