Element.GetMaterial Returns 1 less element

Pretty cut and dry… I have 57 elements going into this block and 56 coming out. I’v been playing around trying to figure out what the deal is but i have not been able to come up with a good answer.

Anyone else run into this and have a solution?

Hi,

Have you compared item to item the two lists too see where does the difference appear ?
I suspect that one of your Curtain Panel does not have any Material associated to it, thus the Element.GetMaterials returning an empty list (which does not count in the “56”).

Also, the List.Create node you used has no purpose :wink: (try deleteing it)

1 Like

It does, there are 3 other families, i narrowed it down to something in this family group is causing the problem. The item it seems to pick always seem to be the last number in the sequence

Please share more info (like a dummy rvt file and/or .dyn). It is really hard to help like this.

You could also try to test Curtain Panel by Curtain Panel to see if one of them is causing the issue.

I haven’t figure it out but i have found there some glitched element that is hidden in the project, no width or height its just a point that seems to be causing the issue

Ick. I hate dimensionless curtain panels… usually this is because someone added a partial grid line which makes a zero dimension panel, or removed a section of grid line after creation. This often happens at doors where you don’t want the million that’s centered on the door opening causing a ‘run into this bar when you leave/enter’ situation.

Filter your curtain panels by area > 0 and you should be all set.