Hi all,
I have tried to create a wall by the face of a column, but at the moment of obtaining the reference of the selected face I get it as null. Any advice to get that reference? Show the code.
Reference pickedObj;
pickedObj = uiDoc.Selection.PickObject(ObjectType.Face, "Select Face");
GeometryObject geometryObject = doc.GetElement(pickedObj).GetGeometryObjectFromReference(pickedObj);
PlanarFace face = geometryObject as PlanarFace;
WallType wType = new FilteredElementCollector(doc)
.OfClass(typeof(WallType))
.Cast<WallType>().FirstOrDefault(q
=> q.Name == "Parapeto e=0.20 m (350 kgm/cm2)");
using (Transaction t = new Transaction(doc))
{
t.Start("Face by Wall");
try
{
FaceWall.Create(doc, wType.Id, WallLocationLine.CoreExterior, face.Reference);
}
catch (Exception ex)
{
TaskDialog.Show("Error", ex.Message);
}
t.Commit();
}
return Result.Succeeded;