Filled Region from space boundary

Hi,

I am working o Electrical project. I want create filled region on room boundary.
I used launch SNU utility for taking information for space boundary.
So I want to create Filled Region from space boundary. I am find out following python script from discussion for creating filled region from room boundary.

import clr

clr.AddReference(“RevitAPI”)
from Autodesk.Revit.DB import *

clr.AddReference(“RevitServices”)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

roomsList = UnwrapElement(IN[0])
filledRegionName = IN[1]

for fr in FilteredElementCollector(doc).OfClass(FilledRegionType):
if Element.Name.GetValue(fr) == filledRegionName:
filledRegion = fr
break

viewId = doc.ActiveView.Id

TransactionManager.Instance.EnsureInTransaction(doc)

regions =
for room in roomsList:
if room.Area > 0:
roomBoundaries = room.GetBoundarySegments(SpatialElementBoundaryOptions())
curveLoopList =
roomCurves = CurveLoop()
for roomBoundary in roomBoundaries:
for boundarySegment in roomBoundary:
roomCurves.Append(boundarySegment.Curve)
curveLoopList.Add(roomCurves)

     region = FilledRegion.Create(doc,filledRegion.Id,viewId, curveLoopList)
     regions.append(region)    

TransactionManager.Instance.TransactionTaskDone()

OUT = regions

is this possible to used this script for creating Filled Region from space boundary or taking room boundary as areference from linked model.

Thanks,
Swapnil

@Swapnil_Raut Try some of the new nodes in 1.2
Here is an example with a Room

1 Like

Thanks Vikram for your suggestion.
I used below nodes for select rooms from linked mode.

So what if I want to apply a filled region pattern to a selection of picked multiple rooms?

After running this graph it works as I thought, however, if I try to run it on another selection group of rooms, it removes the previous hatches and then applioes the new process to my new selection. I do not want this behavior.

Hi @Dave_Vaughn

Could please start your query in a new thread. Thanks :slight_smile:

Done.