Hi,
I'm trying to create a Wall in Revit using specific XYZ coordinates using Create.Wall, but when I try to run it, I get an error saying: "Could not construct a proper face with the input curves to create a wall correctly."
Here is the part of my code where I define the wall line
Dim P1 As Autodesk.Revit.DB.XYZ = Nothing
Dim P2 As Autodesk.Revit.DB.XYZ = Nothing
P1 = New Autodesk.Revit.DB.XYZ(-12, 12, 0)
P2 = New Autodesk.Revit.DB.XYZ(12, 12, 0)
Dim profile As IList(Of Autodesk.Revit.DB.Curve) = New List(Of Autodesk.Revit.DB.Curve)
profile.Add(Line.CreateBound(P1, P2))
Wall.Create(myModel, profile, wallid, levelid, False, normal)
Does anyone have a clue of what I'm doing wrong. Does the profile have to be a closed line?
Thanks
Are you trying to create an oddly shaped wall? The overload of the create method that you are using requires a full profile and you are only feeding in one line, add more lines to close the profile.
If you are just after a standard wall then you need to use the Wall.Create(Document document, Curve curve, ElementId levelId, bool structural) overload.
Example using your code: Wall.Create(myModel, Line.CreateBound(P1, P2), levelid, False)
It doesn't have to be a closed profile.
Could it be because you are using an IList(Curve) instead of a Curve for the Curve argument?