Verification of intersection between rooms<->slabs via PythonScripts return error messages

I have a few questions about my DynamoScript, which is supposed to store an attribute from a floor slab, that is below a room, into a list (only) if the slab is directly below the lower surface of the room.
Target: Display a type description tag of the slab into room-TAGs.

To achieve this, I determine the area center of each room (x/y) and create a small bounding box from it in x and y direction, which is z=-2cm below the actual room, so it intersects the bounding box of any slab directly below.

I overlap this (virtual) bounding box with the (real) bounding box of each floor slab in the model. If there is an overlap, it means that the floor slab is exactly below the centre of gravity of the room.
Then an attribute of this floor slab is copied to use it later for room labelling fields.

This has already worked very well for a test model with simple geometry.
Unfortunately, when applying it to our actual BIM model, error messages appear. I am currently unsure how to proceed. Most of the data processing takes place in Python nodes, which I have programmed in Python (mostly loops).

I would assume that I have to carry out several checks for none/null/empty values? What could these errors be related to? Not closed room boundaries? Overlapping spaces?

Error Codes:
Node: Element.Geometry
“Curve join produced more than one WIRE in polycurve”.

In my PythonScript I get an index out of range exception. I suppose this is connected to null/empty values in my lists, which i need to detect. Maybe I can solve this via try/except blocks.

Node: Element.Geometry
“Unable to make wire from edge body: WIRE_SELF_INTERSECTS2 – Wire has self-intersection”

Can this be connected to overlapping instances of slabs in the model?

I am using as input data:

List of n point coordinates (x/y/z) where each coordinate has 2 values (minimum value and maximum value):
Xmin= centroid of area - 0.1m
Xmax=centre of area + 0.1m
Ymin=Centre of area - 0.1m
Ymax=centre of area + 0.1m
Zmin= Zmax-0.02m
Zmax= lower edge of a space body

List1 thus represents: Small cuboid at the horizontal centre of each room in a Revit model, which extends 2cm below the bottom edge of the room, so that an overlap with floor slabs below can be detected if there is a floor slab there.

List of point coordinates (x/y/z) for floor slabs (bounding boxes):
Xmin=min x of floor slab
Xmax= max x of floor slab
Ymin = min y of floor slab
Ymax = max y of floor slab
Zmin = lower edge of slab in z-direction
Zmax = upper edge of slab in z-direction


PythonWriteSlabTagsToRoomInstances.dyn (82.4 KB)

Element.Geometry node returns a solid for every room except for 5 room instances. For these instances it returns several surfaces + several lines, instead of a solid. Three other Rooms return an empty list. I actually try to filter these rooms out / replace them.

Problem is solved now.

The solution was to replace empty lists and results in Element.Geometry, which are =/ solid
with custom values in the python scripts.

1 Like