Problems with "Floor.ByOutlineTypeAndLevel"

Hello

I have problems with “Floor.ByOutlineTypeAndLevel”. The project is create Floors on Revit from Dynamo. Am using the nodes improperly.

Please your help.

Regards

David

problems_floor_2

 

It looks like your polycurves have 0 area if they are constructed with exactly 2 straight lines and those lines are closed.

It looks like you want to make just one floor plate. Stick a “List.Flatten” node between “Element.Curves” and “PolyCurve.ByJoinedCurves” if so. Then you may need to get rid of PolyCurve.ByClosedLine.

Hello Colin:

To block it worked fine, but selecting multiple items shown in the following error. Are any node or parameter missing?

thank you very much

David

problems_floor_3

David,

The problem here is something that I had inquired with Dynamo team quite a while ago (https://github.com/DynamoDS/Dynamo/issues/2669) and haven’t heard anything back yet. Anyways, I ended up creating a workaround for that. What you have after you flatten all of the input curves is a list that contains multiple “loops” as Dynamo refers to them. In order for the “PolyCurve.ByJoinedCurves” to work properly you need to feed it a list with only curves that are joined to each other, or if you have more than one loop then its a list of lists with each sublist containing only curves that can be joined cleanly. Anyways, try pasting this code into a Python node and see if it works. It’s just a simple function to find “loops” of curves that can be joined. so Whatever output you get from this just plug that into “PolyCurve.ByJoinedCurves” and you should be fine assuming that i didnt miss anything while putting this together hastily (I havent tested it yet.):

Good luck!

David,

I actually wanted to make sure that this works so I tested it on a simple file. Code that I posted above didn’t work as it seems like python assignment operators don’t work with lists or at least not in Dynamo python node. Anyways, I made a small change to the code and it should be good. You can find it here:

And here’s a simple proof of concept image:

Capture

Hello Konrad

Thank you very much for responding.
I did not know he had such problems by combining lines to create “Floors” in Revit.

The link to download the python code returns a blank page. Please if you can share the source code in a text file.

Thank You.

David

#Copyright(c) 2015, Konrad Sobon
# @arch_laboratory, http://archi-lab.net

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

Import DocumentManager and TransactionManager

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

Import RevitAPI

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

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

Import ToDSType(bool) extension method

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

inputCurves = IN[0]

#join/group curves function
def groupCurves(Line_List):
ignore_distance = 0.1 # Assume points this close or closer to each other are touching
Grouped_Lines =
Queue = set()
while Line_List:
Shape =
Queue.add(Line_List.pop()) # Move a line from the Line_List to our queue
while Queue:
Current_Line = Queue.pop()
Shape.append(Current_Line)
for Potential_Match in Line_List:
Points = (Potential_Match.StartPoint, Potential_Match.EndPoint)
for P1 in Points:
for P2 in (Current_Line.StartPoint, Current_Line.EndPoint):
distance = P1.DistanceTo(P2)
if distance <= ignore_distance:
Queue.add(Potential_Match)
Line_List = [item for item in Line_List if item not in Queue]
Grouped_Lines.append(Shape)
return Grouped_Lines

OUT = groupCurves(inputCurves)

Konrad,

I tried the Python code and works only for certain elements. What could be the problem ?.

David

Structure Generator (Floor)

problems_floor_4

duplicate lines? really short segments that fall through tolerance check? It’s autocad that we are talking about here…I will not be surprised if its just sloppy with overlapping lines. Try to reference in smaller chunks of it first, see if it works, then add more. Try to narrow down what possibly is causing errors and then we can continue this conversation.

Konrad,

You’re right, the problem is duplicated in AutoCAD lines. Now it works perfectly and thank you very much for sharing your script.

Another query:

I inserted 2 groups of similar elements (polylines) in Revit. Why when gender slabs in one or another refreshes the entire screen of Revit and erases all previously generated slabs ?. How you can control the screen refresh Revit with Dynamo ?. Also I have to create slabs, beams and columns at the same level and not good to delete the created when running again Dynamo.

David

problems_floor_5

David,

This is another very well known issue/benefit of Dynamo. Personally it annoys me that Dynamo stores this information and will update geometry no matter what. It prevents users from being able to re-use parts of one definition in another or use the same definition on another file. On the other side of the argument you can open that one definition and it really holds associations to one Revit project so you can update that one file sometime down the road without much trouble (in theory).

Anyways, it was discussed and reported as an issue here:

https://github.com/DynamoDS/Dynamo/issues/3273 - more of a refreshing deficiency but somehow related

http://dynamobim.com/forums/topic/create-more-elements-in-revit-from-the-same-dynamo-file/

To also give you a tip on how to handle that. use two Floor.ByOutline… nodes and have two separate nodes that reference in geometry. You cannot just simply re-use the Floor.ByOutline… node.

Konrad,

I think it would be appropriate for the Dynamo have an option where the user check if the execution is to regenerate the entire Revit model or create new items. No entiedo well the option of placing another “Floor.ByOutlineTypeAndLevel”. What I’m doing is closing the file Dynamo after geneneración elements when I want to create new Revit elements at the same level.

Separate issue: The “Notify me of follow-up replies via email” from this forum does not work because I do not get emails from the forum replicas.

1 Like

You could simply pin the objects that have been created earlier and Revit will not delete them. I guess this is a much simpler and more convenient procedure.