/// <summary> /// Exports a footing to IFC footing. /// </summary> /// <param name="exporterIFC"> /// The ExporterIFC object. /// </param> /// <param name="footing"> /// The footing element. /// </param> /// <param name="geometryElement"> /// The geometry element. /// </param> /// <param name="productWrapper"> /// The ProductWrapper. /// </param> public static void ExportFootingElement(ExporterIFC exporterIFC, ContFooting footing, GeometryElement geometryElement, ProductWrapper productWrapper) { String ifcEnumType = "STRIP_FOOTING"; ExportFooting(exporterIFC, footing, geometryElement, ifcEnumType, productWrapper); }
/// <summary> /// get all the required information of selected elements and store them in a data table /// </summary> /// <param name="selectedElements"> /// all selected elements in Revit main program /// </param> /// <returns> /// a data table which store all the required information /// </returns> private DataTable StoreInformationInDataTable(ElementSet selectedElements) { DataTable informationTable = CreatDataTable(); foreach (Element element in selectedElements) { // Get AnalyticalModel analyticalModel = element.GetAnalyticalModel(); if (null == analyticalModel) // skip no AnalyticalModel element { continue; } DataRow newRow = informationTable.NewRow(); string idValue = element.Id.IntegerValue.ToString(); // store element Id value string typeName = ""; // store element type name string[] supportInformation = GetSupportInformation(analyticalModel); // store support information // get element type information switch (element.GetType().Name) { case "ContFooting": ContFooting wallFoot = element as ContFooting; ElementType wallFootSymbol = m_revit.Application.ActiveUIDocument.Document.GetElement(wallFoot.GetTypeId()) as ElementType;// get element Type typeName = wallFootSymbol.Category.Name + ": " + wallFootSymbol.Name; break; case "FamilyInstance": FamilyInstance familyInstance = element as FamilyInstance; FamilySymbol symbol = m_revit.Application.ActiveUIDocument.Document.GetElement(familyInstance.GetTypeId()) as FamilySymbol; typeName = symbol.Family.Name + ": " + symbol.Name; break; case "Floor": Floor slab = element as Floor; FloorType slabType = m_revit.Application.ActiveUIDocument.Document.GetElement(slab.GetTypeId()) as FloorType; // get element type typeName = slabType.Category.Name + ": " + slabType.Name; break; case "Wall": Wall wall = element as Wall; WallType wallType = m_revit.Application.ActiveUIDocument.Document.GetElement(wall.GetTypeId()) as WallType; // get element type typeName = wallType.Kind.ToString() + ": " + wallType.Name; break; default: break; } // set the relative information of current element into the table. newRow["Id"] = idValue; newRow["Element Type"] = typeName; newRow["Support Type"] = supportInformation[0]; newRow["Remark"] = supportInformation[1]; informationTable.Rows.Add(newRow); } return(informationTable); }
GetSymbolRef(Element elem) { ContFooting contFoot = elem as ContFooting; if (contFoot != null) { return(contFoot.FootingType); } FamilyInstance famInst = elem as FamilyInstance; if (famInst != null) { return(famInst.Symbol); } Floor floor = elem as Floor; if (floor != null) { return(floor.FloorType); } Group group = elem as Group; if (group != null) { return(group.GroupType); } Wall wall = elem as Wall; if (wall != null) { return(wall.WallType); } return(null); // nothing we know about }
/// <summary> /// Exports a footing to IFC footing. /// </summary> /// <param name="exporterIFC"> /// The ExporterIFC object. /// </param> /// <param name="footing"> /// The footing element. /// </param> /// <param name="geometryElement"> /// The geometry element. /// </param> /// <param name="productWrapper"> /// The IFCProductWrapper. /// </param> public static void ExportFootingElement(ExporterIFC exporterIFC, ContFooting footing, GeometryElement geometryElement, IFCProductWrapper productWrapper) { String ifcEnumType = "STRIP_FOOTING"; ExportFooting(exporterIFC, footing, geometryElement, ifcEnumType, productWrapper); }
private void Stream( ArrayList data, ContFooting contFooting ) { data.Add( new Snoop.Data.ClassSeparator( typeof( ContFooting ) ) ); data.Add( new Snoop.Data.Object( "Analytical model", contFooting.GetAnalyticalModel() ) ); data.Add( new Snoop.Data.Object( "Footing type", contFooting.FootingType ) ); }
public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication app = commandData.Application; UIDocument uidoc = app.ActiveUIDocument; Document doc = uidoc.Document; Wall wall = Util.SelectSingleElementOfType( uidoc, typeof(Wall), "a wall", false) as Wall; if (null == wall) { message = "Please select a single wall element."; return(Result.Failed); } ICollection <ElementId> delIds = null; using (Transaction t = new Transaction(doc)) { try { t.Start("Temporary Wall Deletion"); delIds = doc.Delete(wall.Id); t.RollBack(); } catch (Exception ex) { message = "Deletion failed: " + ex.Message; t.RollBack(); } } ContFooting footing = null; foreach (ElementId id in delIds) { footing = doc.GetElement(id) as ContFooting; if (null != footing) { break; } } string s = Util.ElementDescription(wall); Util.InfoMsg((null == footing) ? string.Format("No footing found for {0}.", s) : string.Format("{0} has {1}.", s, Util.ElementDescription(footing))); return(Result.Succeeded); }