Hi Dear, I am using this code :
FilteredElementCollector collector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType();
Level lev = collector.Where(e => e.Name.Contains("1")).First() as Level;
FilteredElementCollector wallTypeCollector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsElementType();
WallType wallType = wallTypeCollector.First(e => e.Name == "Generic - 200mm") as WallType;
// create an ilist for the curevs
IList<Curve> curves = new List<Curve>();
// create the Line
XYZ p1 = new XYZ(290.7636, -513.4871, 5.3993);
XYZ p2 = new XYZ(254.2638, -458.9748, 4.1806);
// adding an elevation of 32 units
XYZ p3 = new XYZ(0, 0, 32 ) + p2;
XYZ p4 = new XYZ(0, 0, 32 ) + p1;
// create the curves
// Represents the Line direction
Curve l1 = Line.CreateBound(p1, p2);
Curve l2 = Line.CreateBound(p2, p3);
Curve l3 = Line.CreateBound(p3, p4);
Curve l4 = Line.CreateBound(p4, p1);
curves.Add(l1);
curves.Add(l2);
curves.Add(l3);
curves.Add(l4);
Transaction transaction1 = new Transaction(doc);
transaction1.Start("Create Wall");
// Creating Wall
Wall w1 = Wall.Create(doc, curves, true);
Wall w2 = Wall.Create(doc, curves, wallType.Id, lev.Id, true);
It is creating a wall , However it's not taking the exact shapes of the curves that I want . Any idea why ?