/// <summary> /// Initializes a new instance of the ObjectDataBase from an existing one. /// </summary> /// <param name="data">Object data to copy</param> public ObjectDataBase(ObjectDataBase data) { category = data.Category; material = data.Material; elemId = data.ElementId; label = data.Label; }
/// <summary> /// Initializes a new instance of the ElementDataBase object with list of parameters. /// </summary> /// <param name="elementResult">Element results schema.</param> /// <param name="listcalcPoint">List of the element's calculation points.</param> /// <param name="listSectionData">List of sections' data.</param> /// <param name="elementStatus">Element result status.</param> /// <param name="document">Acces to cref="Document".</param> /// <param name="data">Object with base parameters for the element.</param> public ElementDataBase(Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass elementResult, List <CalcPoint> listcalcPoint, List <SectionDataBase> listSectionData, Autodesk.Revit.DB.CodeChecking.Storage.ResultStatus elementStatus, Document document, ObjectDataBase data) : base(data) { Result = elementResult; calcPoints = listcalcPoint; listSectData = listSectionData; Status = elementStatus; this.document = document; }
/// <summary> /// Reads from Revit information about selected elements and store it in the list with elements data. /// </summary> /// <param name="data">Acces to cref="ServiceData".</param> /// <param name="listElementStatus">List identyficators of elements with result status.</param> /// <param name="parameters">Common parameters.</param> /// <returns>List of elements data.</returns> protected List <ObjectDataBase> ReadListElementData(Autodesk.Revit.DB.CodeChecking.ServiceData data, List <Tuple <ElementId, ResultStatus> > listElementStatus, CommonParametersBase parameters) { Autodesk.Revit.DB.CodeChecking.Storage.StorageService service = Autodesk.Revit.DB.CodeChecking.Storage.StorageService.GetStorageService(); Autodesk.Revit.DB.CodeChecking.Storage.StorageDocument storageDocument = service.GetStorageDocument(data.Document); List <ObjectDataBase> listElementData = new List <ObjectDataBase>(); foreach (Tuple <ElementId, ResultStatus> elemStatus in listElementStatus) { Element element = data.Document.GetElement(elemStatus.Item1); if (element != null) { Autodesk.Revit.DB.CodeChecking.Storage.Label ccLabel = storageDocument.LabelsManager.GetLabel(element); if (ccLabel != null) { Autodesk.Revit.DB.BuiltInCategory category = (Autodesk.Revit.DB.BuiltInCategory)element.Category.Id.IntegerValue; StructuralAssetClass material = ccLabel.Material; Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass label = EngineData.ReadElementLabel(category, material, ccLabel, data); Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass result = EngineData.CreateElementResult(category, material); ObjectDataBase objectData = new ObjectDataBase(elemStatus.Item1, category, material, label); List <SectionDataBase> listSectionsData = new List <SectionDataBase>(); List <CalcPoint> listCalcPoints = EngineData.CreateCalcPointsForElement(data, parameters, elemStatus.Item1); foreach (CalcPoint p in listCalcPoints) { SectionDataBase sectBase = new SectionDataBase(p, objectData); SectionDataBase sectData = EngineData.CreateSectionData(sectBase); listSectionsData.Add(sectData); } ElementDataBase elemBase = new ElementDataBase(result, listCalcPoints, listSectionsData, elemStatus.Item2, data.Document, objectData); ElementDataBase elemData = EngineData.CreateElementData(elemBase); listElementData.Add(elemData); } } } return(listElementData); }
/// <summary> /// Initializes a new instance of the SectionDataBase object with list of parameters. /// </summary> /// <param name="point">Calculation point.</param> /// <param name="data">Object with base parameters for the section.</param> public SectionDataBase(CalcPoint point, ObjectDataBase data) : base(data) { calcPoint = point; }