Hello,
Looks like you wrote f.get
instead of floor.get
in your loop
Cordially
christian.stan
Hello,
Looks like you wrote f.get
instead of floor.get
in your loop
Cordially
christian.stan
hi, yes you are right, but in this example it does not get a list, but an instance, so the execution goes into the else: part
You will have to wait for people much more savvy than me in python (super beginner mode but it progresses slowly but surely (today I learned the Sets and the Union and Intersection methods)
Cordially
christian.stan
Hello @danail.momchilov
I don“t know what your goal is.
In this thread was shown, that all problems with converting to Dynamo geometry can be avoided by just using Revit geometry and not converting it at all. So why don“t you just use the Revit geometry like i did? I did not convert it.
Only now I realized what your general idea was⦠sorry about that, it just took some time⦠thank you for your thread, I think it could really help a great deal, as I have been struggling with this issue for a long time on many of our workflows!
hereās what I did with floors:
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
opt = Options()
outlist = []
floors = UnwrapElement(IN[0])
for floor in floors:
templist = []
solid = floor.get_Geometry(opt)
for f in solid:
faces = f.Faces
for face in faces:
try:
if face.FaceNormal.Z == 1:
outlist.append(face)
except:
pass
OUT = outlist
Since I only need the uppermost face of each floor, I would just check all face normals of the floorās solids and only get the ones that have a Z component equal to 1. Did some testing to make sure I get the correct ones, by building small floors, that are kind of āwrappableā (just to be able to visualize it) and it all seems fine