Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating New Wall

2 REPLIES 2
Reply
Message 1 of 3
thiago.loddi
406 Views, 2 Replies

Creating New Wall

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 

 

 

 


                             
                             

2 REPLIES 2
Message 2 of 3
Scott_Wilson
in reply to: thiago.loddi

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)

Message 3 of 3
santiagodiaz
in reply to: thiago.loddi

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?

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community