Hi All,
I’m traying to create walls from lines using profil method as described below:
but I’m getting thie following error in the RPS console:
Exception : Autodesk.Revit.Exceptions.InvalidOperationException: Could not construct a proper face with the input curves to create a wall correctly.
à Autodesk.Revit.DB.Wall.Create(Document document, IList`1 profile, ElementId wallTypeId, ElementId levelId, Boolean structural)
Pls check my code below:
from Autodesk.Revit.DB import *
from System.Collections.Generic import IList, List
uidoc = __revit__.ActiveUIDocument
doc = uidoc.Document
t = Transaction(doc, 'create Model lines')
wall_Types = FilteredElementCollector(doc).OfCategory(BuiltInCategory.INVALID).OfClass(WallType).ToElementIds()
levels = FilteredElementCollector(doc).OfCategory(BuiltInCategory.INVALID).OfClass(Level).ToElementIds()
for w in wall_Types:
w_type = doc.GetElement(w)
if w_type.Name == "Ext. Voile BA 20":
wall_Id = w
for l in levels:
lvl = doc.GetElement(l)
if lvl.Name == "Niveau 0":
lvl_Id = l
# Create Points and Lines:
c = 1/0.3048
Pt0 = XYZ(-0.60*c,-0.60*c,0)
Pt1 = XYZ(0.60*c,-0.60*c,0)
Pt2 = XYZ(0.60*c,0.60*c,0)
Pt3 = XYZ(-0.60*c,0.60*c,0)
Lines = []
Line1 = Line.CreateBound(Pt0, Pt1)
Lines.append(Line1)
Line2 = Line.CreateBound(Pt1, Pt2)
Lines.append(Line2)
Line3 = Line.CreateBound(Pt2, Pt3)
Lines.append(Line3)
Line4 = Line.CreateBound(Pt3, Pt0)
Lines.append(Line4)
Curves = List[Curve]()
t.Start()
for i in Lines:
Curves.Add(i)
Walls = Wall.Create(doc, Curves, wall_Id, lvl_Id, True)
t.Commit()
Can you help me to solve this issue pls?
Thanks.