// // (C) Copyright 2003-2019 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.Text; using System.ComponentModel; using Autodesk.Revit.DB.Structure; namespace Revit.SDK.Samples.NewRebar.CS { /// /// Dimension on RebarShapeDefByArc. /// abstract class ConstraintOnArcShape : ConstraintOnRebarShape { /// /// Dimension to constrain the arc shape. /// protected RebarShapeParameter m_rebarShapeParameter; public ConstraintOnArcShape(RebarShapeDefByArc def) : base(def) { } /// /// Dimension to constrain the arc shape. /// [DisplayName("RebarShape parameter"), TypeConverter(typeof(TypeConverterRebarShapeParameter)), ReadOnly(false)] public virtual RebarShapeParameter RebarShapeParameter { get { UpdateParameterTypeConverter(); return m_rebarShapeParameter; } set { m_rebarShapeParameter = value; } } /// /// Get RebarShapeDefinitionByArc object. /// protected RebarShapeDefinitionByArc GetRebarShapeDefinitionByArc { get { return m_shapeDef.RebarshapeDefinition as RebarShapeDefinitionByArc; } } } /// /// Arc length dimension. /// class ConstraintArcLength : ConstraintOnArcShape { public ConstraintArcLength(RebarShapeDefByArc def) : base(def) { } /// /// Add dimension to constrain the arc length. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintArcLength( RebarShapeParameter.Parameter); } } /// /// Arc chord length dimension. /// class ConstraintChordLength : ConstraintOnArcShape { public ConstraintChordLength(RebarShapeDefByArc def) : base(def) { } /// /// Add dimension to constrain the arc chord length. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintChordLength( RebarShapeParameter.Parameter); } } /// /// Arc circumference dimension. /// class ConstraintCircumference : ConstraintOnArcShape { /// /// Arc reference type. /// private RebarShapeArcReferenceType m_arcReferenceType; public ConstraintCircumference(RebarShapeDefByArc def) : base(def) { m_arcReferenceType = RebarShapeArcReferenceType.External; } /// /// Arc reference type. /// public RebarShapeArcReferenceType ArcReferenceType { get { return m_arcReferenceType; } set { m_arcReferenceType = value; } } /// /// Add dimension to constrain the arc circumference. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintCircumference( RebarShapeParameter.Parameter, ArcReferenceType); } } /// /// Arc diameter dimension. /// class ConstraintDiameter : ConstraintOnArcShape { /// /// Arc reference type. /// private RebarShapeArcReferenceType m_arcReferenceType; public ConstraintDiameter(RebarShapeDefByArc def) : base(def) { m_arcReferenceType = RebarShapeArcReferenceType.External; } /// /// Arc reference type. /// public RebarShapeArcReferenceType ArcReferenceType { get { return m_arcReferenceType; } set { m_arcReferenceType = value; } } /// /// Add dimension to constrain arc diameter. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintDiameter( RebarShapeParameter.Parameter, ArcReferenceType); } } /// /// Arc radius dimension. /// class ConstraintRadius : ConstraintOnArcShape { /// /// Arc reference type. /// private RebarShapeArcReferenceType m_arcReferenceType; public ConstraintRadius(RebarShapeDefByArc def) : base(def) { m_arcReferenceType = RebarShapeArcReferenceType.External; } /// /// Arc reference type. /// public RebarShapeArcReferenceType ArcReferenceType { get { return m_arcReferenceType; } set { m_arcReferenceType = value; } } /// /// Add dimension to constrain the radius of arc. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintRadius( RebarShapeParameter.Parameter, ArcReferenceType); } } /// /// Arc Sagittarius length dimension. /// class ConstraintSagittaLength : ConstraintOnArcShape { public ConstraintSagittaLength(RebarShapeDefByArc def) : base(def) { } /// /// Add dimension to constrain the Sagittarius length of arc. /// public override void Commit() { GetRebarShapeDefinitionByArc.AddConstraintSagittaLength( RebarShapeParameter.Parameter); } } }