// // (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.ExtensibleStorage; using Autodesk.Revit.DB; using CodeCheckingConcreteExample.ConcreteTypes; using CT = CodeCheckingConcreteExample.ConcreteTypes; using Autodesk.Revit.DB.CodeChecking.Engineering.Concrete.ConcreteTypes; using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes; using Autodesk.Revit.UI.ExtensibleStorage.Framework; namespace CodeCheckingConcreteExample { /// /// /// Values validator for beam label. /// public class ValueValidatorWall : IFieldValidator { /// /// Validates the value. /// /// The entity. /// The field. /// The value. /// The unit. /// public bool ValidateValue(object entity, string field, object value, DisplayUnitType unit) { if (field == "CreepCoefficient") { return (double)value > 0; } return true; } } /// /// Represents labels. /// [Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LabelWall", "47899fc7-3396-4c02-b8a1-98d720d540d2")] public class LabelWall : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass { /// /// Classification of available forces for column /// public enum EnabledInternalForcesForWall { /// /// Axial force. Fxx and Fyy. /// FX = ConcreteTypes.EnabledInternalForces.FX, MX = ConcreteTypes.EnabledInternalForces.MY, } /// /// Collection of beam simple calculation /// representing calculation options chosen by the user /// [Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "WallCalculationType")] [EnumControl(Description = "EnabledInternalForces", Category = "CalculationOptions", EnumType = typeof(EnabledInternalForcesForWall), Presentation = PresentationMode.OptionList, Item = PresentationItem.ImageWithText, ImageSize = ImageSize.Medium, Context = "WallLabel")] [Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "EnabledInternalForces", Index = 1, Localizable=true, LocalizableValue = true)] public List EnabledInternalForcesWall { get; set; } /// /// Rebar parameters component for vertical reinforcement /// [Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "VerticalRnfSteelParameters")] [CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "VerticalRnfSteelParameters")] [Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "VerticalRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)] public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema VerticalReinforcement { get; set; } /// /// Rebar parameters component for horizontal reinforcement /// [Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "HorizontalRnfSteelParameters")] [CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "HorizontalRnfSteelParameters")] [Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "HorizontalRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)] public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema HorizontalReinforcement { get; set; } /// /// Creep coefficient /// [Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CreepCoefficient", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)] [Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Description = "CreepCoefficient", Category = "CalculationOptions", IsVisible = true, IsEnabled = true, Index = -1, Localizable = true, FieldValidator = typeof(ValueValidatorWall))] [Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "CreepCoefficient", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)] public Double CreepCoefficient { get; set; } /// /// Longitudinal calculation type (shearing, tortion, ...) /// public ConcreteTypes.CalculationType LongitudinalCalculationType { get { return EnabledInternalForces.GetLongitudinalCalculationType(); } } /// /// Returns EnabledInternalForces based on EnabledInternalForcesFloor /// public List EnabledInternalForces { get { List EInternalForces = new List(); foreach (EnabledInternalForcesForWall enabledInternalForcesWall in EnabledInternalForcesWall) { EInternalForces.Add((ConcreteTypes.EnabledInternalForces)enabledInternalForcesWall); } return EInternalForces; } } /// /// Creates default LabelWall /// public LabelWall() { VerticalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema(); HorizontalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema(); CreepCoefficient = 2.0; EnabledInternalForcesWall = new List(); EnabledInternalForcesWall.Add(EnabledInternalForcesForWall.FX); EnabledInternalForcesWall.Add(EnabledInternalForcesForWall.MX); } } /// }