Exemple #1
0
        /// <summary>
        /// Creates a new DimensionStyle that is a copy of the current instance.
        /// </summary>
        /// <param name="newName">DimensionStyle name of the copy.</param>
        /// <returns>A new DimensionStyle that is a copy of this instance.</returns>
        public override TableObject Clone(string newName)
        {
            DimensionStyle copy = new DimensionStyle(newName)
            {
                // dimension lines
                DimLineColor       = (AciColor)dimclrd.Clone(),
                DimLineLinetype    = (Linetype)dimltype.Clone(),
                DimLineLineweight  = dimlwd,
                DimLine1Off        = dimsd1,
                DimLine2Off        = dimsd2,
                DimBaselineSpacing = dimdli,
                DimLineExtend      = dimdle,

                // extension lines
                ExtLineColor      = (AciColor)dimclre.Clone(),
                ExtLine1Linetype  = (Linetype)dimltex1.Clone(),
                ExtLine2Linetype  = (Linetype)dimltex2.Clone(),
                ExtLineLineweight = dimlwe,
                ExtLine1Off       = dimse1,
                ExtLine2Off       = dimse2,
                ExtLineOffset     = dimexo,
                ExtLineExtend     = dimexe,

                // symbols and arrows
                ArrowSize      = dimasz,
                CenterMarkSize = dimcen,
                LeaderArrow    = (Block)dimldrblk?.Clone(),
                DimArrow1      = (Block)dimblk1?.Clone(),
                DimArrow2      = (Block)dimblk2?.Clone(),

                // text appearance
                TextStyle               = (TextStyle)dimtxsty.Clone(),
                TextColor               = (AciColor)dimclrt.Clone(),
                TextFillColor           = (AciColor)dimtfillclr?.Clone(),
                TextHeight              = dimtxt,
                TextHorizontalPlacement = dimjust,
                TextVerticalPlacement   = dimtad,
                TextOffset              = dimgap,
                TextFractionHeightScale = dimtfac,

                // fit
                FitDimLineForce  = dimtofl,
                FitDimLineInside = dimsoxd,
                DimScaleOverall  = dimscale,
                FitOptions       = dimatfit,
                FitTextInside    = dimtix,
                FitTextMove      = dimtmove,

                // primary units
                AngularPrecision             = dimadec,
                LengthPrecision              = dimdec,
                DimPrefix                    = dimPrefix,
                DimSuffix                    = dimSuffix,
                DecimalSeparator             = dimdsep,
                DimScaleLinear               = dimlfac,
                DimLengthUnits               = dimlunit,
                DimAngularUnits              = dimaunit,
                FractionType                 = dimfrac,
                SuppressLinearLeadingZeros   = suppressLinearLeadingZeros,
                SuppressLinearTrailingZeros  = suppressLinearTrailingZeros,
                SuppressZeroFeet             = suppressZeroFeet,
                SuppressZeroInches           = suppressZeroInches,
                SuppressAngularLeadingZeros  = suppressAngularLeadingZeros,
                SuppressAngularTrailingZeros = suppressAngularTrailingZeros,
                DimRoundoff                  = dimrnd,

                // alternate units
                AlternateUnits = (DimensionStyleAlternateUnits)alternateUnits.Clone(),

                // tolerances
                Tolerances = (DimensionStyleTolerances)tolerances.Clone()
            };

            foreach (XData data in XData.Values)
            {
                copy.XData.Add((XData)data.Clone());
            }

            return(copy);
        }
 /// <summary>
 /// Creates a new <c>LinetypeShapeSegment</c> that is a copy of the current instance.
 /// </summary>
 /// <returns>A new <c>LinetypeShapeSegment</c> that is a copy of this instance.</returns>
 public override object Clone()
 {
     return(new LinetypeTextSegment(text, (TextStyle)style.Clone(), Length, offset, rotationType, rotation, scale));
 }