// // (C) Copyright 2003-2013 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // using System; using System.Collections.Generic; using System.Linq; using System.Text; using Autodesk.Revit.DB; using Autodesk.Revit.DB.CodeChecking.Engineering; using Autodesk.Revit.DB.CodeChecking.Storage; namespace CodeCheckingConcreteExample.Engine { /// /// Represents a base of element data. /// public class ElementDataBase : ObjectDataBase { /// /// Initializes a new instance of the ElementDataBase object with list of parameters. /// /// Element results schema. /// List of the element's calculation points. /// List of sections' data. /// Element result status. /// Acces to cref="Document". /// Object with base parameters for the element. public ElementDataBase(Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass elementResult, List listcalcPoint, List 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; } /// /// Initializes a new instance of the ElementDataBase from an existing one. /// /// Element data to copy. public ElementDataBase(ElementDataBase elementDataBase) : base(elementDataBase as ObjectDataBase) { Result = elementDataBase.Result; calcPoints = elementDataBase.ListCalcPoints; listSectData = elementDataBase.ListSectionData; Status = elementDataBase.Status; document = elementDataBase.document; } private ElementDataBase() { } /// /// Result schema of the element. /// public Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass Result { get; set; } /// /// List of calculation points cref="CalcPoint" of the element. /// public List ListCalcPoints { get { return calcPoints; } } /// /// List of sections data of the element. /// public List ListSectionData { get { return listSectData; } } /// /// Gets and sets the element's result status. /// public Autodesk.Revit.DB.CodeChecking.Storage.ResultStatus Status { get; set; } /// /// Adds the formated error to cref="Status". /// /// The message. /// if set to true [notify]. public void AddFormatedError(ResultStatusMessage message, bool notify = true) { Status.AddError(message, document, notify); } /// /// Adds the formated info to cref="Status". /// /// The message. /// if set to true [notify]. public void AddFormatedInfo(ResultStatusMessage message, bool notify = true) { Status.AddInfo(message, document, notify); } /// /// Adds the formated warning to cref="Status". /// /// The message. /// if set to true [notify]. public void AddFormatedWarning(ResultStatusMessage message, bool notify = true) { Status.AddWarning(message, document, notify); } List calcPoints; private List listSectData; /// /// Revit document /// protected Document document; } }