Floor.Plan.ByRoom node by archi-lab - combine multiple rooms

Hi,

I need to create floorplans and crop apartments by Housing number (multiple rooms). I have a room parameter with unique numbers. Now I have grouped rooms, and have keys for prefix ready, but it seems like the Floor.Plan.ByRoom node group by room number, or room name and crop only one room per floorplan view. Maybe I need to change the script. Please se attached screendumps that shows what I have and what I need + my graph. Anyone have an idea? Thanks!!

CropHousingPlanViews.dyn (16.0 KB) Issue|690x319

Hi Anders,

I think the problem are in the different list structures of rooms and their unique keys.
Try to set the lacing to “longest” instead of using levels.

image

Thanks Kibar,

Now i get the right match with housing nr. room parameter, and view name. But there is still only one room cropped, and not all room with same housing number. Any suggestions?

Ah, i understand now. Sorry must have skipped the part about a combined floor plan by grouped rooms…

The FloorPlan.ByRoom node uses the bounding box of the room to crop the new plan. It does not add several bounding boxes to create a new view. 1 room = 1 floor plan.

A possible workflow would be:

  1. group rooms (as you´ve already done)
  2. create a new view per group (FloorPlanView.ByLevel, OOTB)
    2.1 you need a unique name per group (play with strings)
  3. combine bounding boxes by group (BoundingBox.FromBoundingBoxes, clockwork)
  4. set crop of view to bounding box (Views.SetCropBox, archilab)

You´d be missing the extended bounding boxes as in the FloorPlan.ByRoom node. My packages are not up-to-date since I can´t find the clockwork node.

I´ll see if I can put it together by tonight/tomorrow evening.

EDIT :
Well, it worked as i outlined. Added the offset of the bounding boxes as well.

And here is the file: CropHousingPlanViews.dyn (77.5 KB)

2 Likes

Hi, Kibar,

Thank you for your help. Bounding boxes and coordinates is something i need to work more on. Unfortunately I have Revit 2020 with Dynamo 2.3, and cannot use the last note - Views.SetCropBox from 2021 package. If you have a quick solution, I would love to know, else thank you very much.

1 Like

Here is a python version of the node. I basically copied Konrads code from the archi-lab package to this python node.

# based on archi-lab node View.SetCropBox

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

views = UnwrapElement(IN[0])
boxes = IN[1]

TransactionManager.Instance.EnsureInTransaction(DocumentManager.Instance.CurrentDBDocument);

for view, box in zip(views, boxes):
	view.CropBoxActive = True
	view.CropBoxVisible = True
	view.CropBox = box.ToRevitType()

TransactionManager.Instance.TransactionTaskDone()

OUT = views
1 Like

And the magic happened! Thanks again Kibar.

1 Like

Hi again,
I will have to run the graph for every level to get all apartments, and the first time works perfect. But when I run the next level, all views I just made is gone. Just make no sense. The only thing I have changed is the names of the views, and add view template.CropHousingPlanViews2.dyn (90.6 KB)

Hey,
Element Binding
The following link does somehow not work for me (i hope it´s just me), but there is a great post by JacobSmall where he explains what it is and how you can use it.

The basics: ID´s of elements that have been created with this script are “bound” to the script. That way you can update elements without recreating them each time you run the script.

Quick fix:

  • Open the script
  • Disconnect input nodes and run the script (every node should return “null” or throw an error.
  • Reconnect and save the script
  • Run script on Level1
  • Close script (not saving!)
  • Open again and run for Level2

There might be a more permanent solution in that post of JacobSmall.
The best would be to run it through the Dynamo Player, since the file does not save between runs. Remember to set your inputs in the graph:
image

2 Likes

Worked through dynamo player! thanks!

1 Like