Last active
November 30, 2023 11:04
-
-
Save danielherrerohernando/4603dd4099a1217e5ac21a10423937cb to your computer and use it in GitHub Desktop.
Example of multiple floors creation for a given list of levels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
clr.AddReference('ProtoGeometry') | |
from Autodesk.DesignScript.Geometry import * | |
clr.AddReference('RevitAPI') | |
from Autodesk.Revit.DB import * | |
clr.AddReference('RevitNodes') | |
import Revit | |
clr.ImportExtensions(Revit.GeometryConversion) | |
clr.ImportExtensions(Revit.Elements) | |
clr.AddReference('RevitServices') | |
import RevitServices | |
from RevitServices.Persistence import DocumentManager | |
from RevitServices.Transactions import TransactionManager | |
doc = DocumentManager.Instance.CurrentDBDocument | |
#Preparing input from dynamo to revit | |
lines = IN[0].ToRevitType() | |
floorType = UnwrapElement(IN[1]) | |
levels = IN[2] | |
isStructural = IN[3] | |
randomNumbers = IN[4] | |
boundary = CurveArray() | |
#Filling the CurveArray | |
for i in lines: | |
boundary.Append(i) | |
#Here we will store the created floors | |
floors = [] | |
#Do the action in a Transaction | |
TransactionManager.Instance.EnsureInTransaction(doc) | |
for level, randomRotation in zip(levels,randomNumbers): | |
floor = doc.Create.NewFloor(boundary,floorType,UnwrapElement(level),isStructural) | |
floorOffset = floor.get_Parameter(BuiltInParameter.FLOOR_HEIGHTABOVELEVEL_PARAM) | |
floorOffset.Set(0) | |
ElementTransformUtils.RotateElement(doc,floor.Id,Line.CreateBound(XYZ(0,0,0),XYZ(0,0,1)),randomRotation*360) | |
floors.append(floor) | |
TransactionManager.Instance.TransactionTaskDone() | |
OUT = floors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The epoxy coating provides a seamless and glossy finish that is resistant to stains, chemicals, and abrasions, making it an ideal choice for high-traffic areas such as commercial spaces and garage floors. epoxy flake floors are easy to clean and maintain, requiring minimal effort to keep them looking pristine. With its numerous benefits, it is no wonder that epoxy flake floor Brisbane are becoming increasingly popular in Brisbane.