How to Create a Wall with Variable Start/End Heights via Revit API?

How to Create a Wall with Variable Start/End Heights via Revit API?

F_Bgdh
Enthusiast Enthusiast
197 Views
4 Replies
Message 1 of 5

How to Create a Wall with Variable Start/End Heights via Revit API?

F_Bgdh
Enthusiast
Enthusiast

Hi everyone,

Is it possible to create a standard wall in Revit and then modify its profile so that the wall has different heights at its start and end points?

Context:

In my UI, the user specifies: a height at the start point of the wall, a different height at the end point of the wall. So the wall should not have a uniform top, but instead one side higher than the other (an inclined/trapezoidal geometry).

Goal:

I’m looking for a solution in the Revit API (2024, and if possible 2026) that allows generating this type of wall with variable heights.

 

Thanks in advance for your help!


3d_sewer_storm_water_outlet_49_00006.jpg

0 Likes
Accepted solutions (2)
198 Views
4 Replies
Replies (4)
Message 2 of 5

Charles.Piro
Advisor
Advisor
Accepted solution

Hi,

 

with the Revit API you can create a wall with a specific profile. So, if you define all the points of your wall, you can create the curves between them and create a new wall.
Here is the documentation for creating a wall by profile : https://www.revitapidocs.com/2024/8d651eae-ae63-bc50-5f43-383d71ec4301.htm 

 

😉



PIRO Charles
Developer

PIRO CIE
Linkedin


Message 3 of 5

Mohamed_Arshad
Advisor
Advisor
Accepted solution

Hi @F_Bgdh 

 

As @Charles.Piro  mentioned you need use the Create Method (Document, IList(Curve), ElementId, ElementId, Boolean) to create wall. I have additionally added the sample implementation of method for your reference.

 

Reference Code

 /// Units mm
 ///Create Profile
 ///              * P3
 ///          *   *
 ///       *      *
 /// P4 *         *
 ///    *         *
 ///    *         *
 /// P1 * * * * * * P2

 ///Points Creation
 XYZ p1 = XYZ.Zero;
 XYZ p2 = new XYZ(5000 / 304.8, p1.Y, p1.Z);
 XYZ p3 = new XYZ(p2.X, p1.Y, 10000 / 304.8);
 XYZ p4 = new XYZ(p1.X, p1.Y, 5000 / 304.8);

 List<Curve> profile = new List<Curve>()
 {
     Line.CreateBound(p1,p2),
     Line.CreateBound(p2,p3),
     Line.CreateBound(p3,p4),
     Line.CreateBound(p1,p4)
 };



 ///Get Default Wall type
 ElementId wallTypeId = new FilteredElementCollector(doc).OfClass(typeof(WallType)).FirstElementId();

 ///Get Level Id
 ElementId levelId=  new FilteredElementCollector(doc).OfClass(typeof(Level)).FirstElementId();

 ///Is Structural
 bool isStructural = false;


 using (Transaction createWall = new Transaction(doc,"Create Wall"))
 {
     createWall.Start();

     Wall wall= Wall.Create(doc,profile,wallTypeId,levelId,isStructural);    

     createWall.Commit();
 }

Hope this will helps 🙂


Mohamed Arshad K
Software Developer (CAD & BIM)

Message 4 of 5

F_Bgdh
Enthusiast
Enthusiast

Thank you so much, @Charles.Piro , for your help with your Revit API solution it really unblocked me 😁

0 Likes
Message 5 of 5

F_Bgdh
Enthusiast
Enthusiast

Many thanks to @Mohamed_Arshad  for providing such a detailed and well-explained Revit API solution. Your guidance was invaluable and really helped me progress. 👏

0 Likes