How to find empty spaces?

Hello,

is this even resolvable? how can i detect “white spaces”. One Modelrule is that every “space” is coverd by construction or space(rooms)? Can i do that just a visual setting by hand?

KR

Andreas

1 Like

Think it will be a tough one, looking forward for good ideas here;)

Our client proves us via Solibri, it is part of his rulesettings. I try as good as possible to manage it in nativ inviroment.

Hmm, tough one, but wouldn’t the manual method you have shown above be more effective?

Here is my schematic idea for doing this, though, via dynamo.

  1. Get all the wall interior and exterior location lines.
  2. Find the intersection point between these location lines.
  3. Use the intersection points to create polycurves/polygons.
  4. Get the perimeter curves of all the rooms/spaces in view.
  5. Use the does.intersect node to determine if the polycurves/polygons in 3 intersect with the polygons/solids made from the room curves.

The polygons not intersecting with the room curves would be the empty spaces. You could then place rooms/spaces at the centre points of the non-intersecting polygons. :thinking::thinking:

Interesting thread here that might help. I’ve become interested in this. Haha.

4 Likes

Here is a way there probably coulds work in some cases…its dirty and should not run on big projects;)


2 Likes

Hacked this together during a call earlier; not entirely perfect but it should help you out. Added the room creation as ‘fixing the problem’ is often the end goal, but the points should ‘find the problem locations’ which is the end goal.

The big benefit here is that there is ZERO geometry effort beyond converting some UVs into points (quick and easy), as it utilizes the PlanTopology class of the Revit API - the non-geometric set of relationships formed by the ‘cells’ created by geometry at a given level. There are a LOT of uses for this class (identification of required separation for noise/fire/air/smell/contamination/whatnot as one example), so worth studying up on this class if it’s something you deal with and you’re into automation.

#### sets up the Dynamo Python environment ####
import clr #imports the common language runtime (CLR) into the Dynamo Python environment
clr.AddReference("RevitNodes") #adds the Revit Nodes library to the CLR
import Revit #imports the Revit class into the Dynamo Python environment
clr.ImportExtensions(Revit.Elements) #adds the RevitElements conversion library to the CLR
clr.ImportExtensions(Revit.GeometryConversion) #adds the Dynamo geometry converstion library to the CLR
clr.AddReference("RevitServices") #adds the Revit services library to the CLR
import RevitServices #imports the RevitServices clas to the Dynamo Python environment
from RevitServices.Persistence import DocumentManager #imports the DocumentManager class into the Dynamo Python environment
clr.AddReference("RevitAPI") #adds the RevitAPI to the CLR
import Autodesk #imports the Autodesk class into the Dynamo Python environment
from Autodesk.Revit.DB import  UV,XYZ,FilteredElementCollector,BuiltInCategory, PlanTopology #imports the needed parts from the Revit API into the Dynamo Python environment

#### preps the inputs and global variables ####
doc = DocumentManager.Instance.CurrentDBDocument #sets the doc varaible to the currently active document
phase = UnwrapElement(IN[0]) #sets the phase variable to the phase given in IN[0] from the Dynamo environment
lvls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType() #sets the lvls variable to the list of levels in the project via a filtered element collector
pointsNeedingRoom = [] #sets the pointsNeedingRoom varaible to an empty list

#### functional coding happens here ####
for lvl in lvls: #for every level in the lvls varible perform the offset lines below
	topo = doc.PlanTopology[lvl,phase] #gets the plantopology for the level at the phase given in the input
	circuits = topo.Circuits #gets the plan circuits (closed spaces) in the plan topology
	noRoom = [c for c in circuits if not c.IsRoomLocated] #gets the list of circuits with no room in them
	rmLocs = [c.GetPointInside() for c in noRoom] #gets a UV point in the empty circuit
	elev = lvl.Elevation #gets the elevation of the current level
	pnts = [XYZ(loc.U, loc.V, elev+0.1).ToPoint() for loc in rmLocs ] #builds a new Dynamo point using the deconstructed UV values and a slightly elevated level elevation
	pointsNeedingRoom.append(pnts) #appends the list of points into the pointsNeedignRoom variable

#### returns the results into the Dynamo environment
OUT = zip(lvls,pointsNeedingRoom) #sends a [level: points] pairing to the Dynamo environment

10 Likes

Hi Jacob. Awesome stuff.
Is this one of the newly exposed classes?

Nope - been around since at least 2017.

3 Likes

Hello,


I have this error message it can come from what (I tried the 2 python engines)

edit:
to modify:
I think I have to take action first but I have a shortcoming at this level

Sincerely
christian.stan

Does it run in the IronPython 2 engine?

Not same error message for both engines
image

cordially
christian.stan

That is a new error message though, so a step in the right direction. Try adding a transaction wrapping like 22 (which I wouldn’t think would be needed based on what I was doing before).

2 Likes

thanks
resolved

cordially
christian.stan

5 Likes

@jacob.small does this solution using PlanTopology also work for linked rooms, or only local rooms? Please confirm, thank you

I haven’t tried; however since the ‘cells’ are generated by the level, and include the solids of room bounding elements, I would imagine that it takes into account links… Fairly certain that the standard command to generate rooms utilizes this same method actually, so make it fairly certain not imagining. However you should test in the context of your project.

All of that said, I don’t recommend generating rooms/spaces in more than one file on a project as it complicates phasing and management by a TON. Instead I recommend assemble them all in a combined model. Certainly there are projects where specific circumstances might steer me away from that process, but it’d be a rare deviation if I were in charge of the BIM execution plans for a firm.

4 Likes