Exemplo n.º 1
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfTolerance dxfTolerance = (DxfTolerance)from;

            this.dxfDimensionStyleOverrides_0 = dxfTolerance.dxfDimensionStyleOverrides_0 != null?dxfTolerance.dxfDimensionStyleOverrides_0.Clone(cloneContext) : (DxfDimensionStyleOverrides)null;

            this.point3D_0  = dxfTolerance.point3D_0;
            this.string_0   = dxfTolerance.string_0;
            this.vector3D_0 = dxfTolerance.vector3D_0;
            this.vector3D_1 = dxfTolerance.vector3D_1;
        }
Exemplo n.º 2
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfLeader dxfLeader = (DxfLeader)from;

            if (dxfLeader.dxfDimensionStyleOverrides_0 != null)
            {
                this.dxfDimensionStyleOverrides_0 = dxfLeader.dxfDimensionStyleOverrides_0.Clone(cloneContext);
            }
            this.bool_2               = dxfLeader.bool_2;
            this.leaderPathType_0     = dxfLeader.leaderPathType_0;
            this.leaderCreationType_0 = dxfLeader.leaderCreationType_0;
            this.hookLineDirection_0  = dxfLeader.hookLineDirection_0;
            this.bool_3               = dxfLeader.bool_3;
            this.double_2             = dxfLeader.double_2;
            this.double_3             = dxfLeader.double_3;
            this.list_0.AddRange((IEnumerable <WW.Math.Point3D>)dxfLeader.list_0);
            this.color_0 = dxfLeader.color_0;
            if (dxfLeader.AssociatedAnnotation == null)
            {
                this.AssociatedAnnotation = (DxfEntity)null;
            }
            else if (cloneContext.SourceModel == cloneContext.TargetModel)
            {
                this.AssociatedAnnotation = dxfLeader.AssociatedAnnotation;
            }
            else
            {
                this.AssociatedAnnotation = (DxfEntity)dxfLeader.AssociatedAnnotation.Clone(cloneContext);
                cloneContext.method_0((DxfHandledObject)this.AssociatedAnnotation);
            }
            this.vector3D_0 = dxfLeader.vector3D_0;
            this.vector3D_1 = dxfLeader.vector3D_1;
            this.vector3D_2 = dxfLeader.vector3D_2;
            this.vector3D_3 = dxfLeader.vector3D_3;
        }
Exemplo n.º 3
0
        public static void smethod_0(
            DxfDimensionStyleOverrides dimensionStyle,
            DxfExtendedData extendedData,
            Class374 modelBuilder)
        {
            DxfExtendedData.ValueCollection valueCollection = (DxfExtendedData.ValueCollection)null;
            for (int index1 = 0; index1 < extendedData.Values.Count; ++index1)
            {
                DxfExtendedData.String @string = extendedData.Values[index1] as DxfExtendedData.String;
                if (@string != null && @string.Value == "DSTYLE")
                {
                    int index2 = index1 + 1;
                    if (index2 < extendedData.Values.Count)
                    {
                        valueCollection = extendedData.Values[index2] as DxfExtendedData.ValueCollection;
                        break;
                    }
                    break;
                }
            }
            if (valueCollection == null)
            {
                return;
            }
            for (int index1 = 0; index1 < valueCollection.Count; index1 += 2)
            {
                DxfExtendedData.Int16 int16 = valueCollection[index1] as DxfExtendedData.Int16;
                if (int16 != null)
                {
                    short num    = int16.Value;
                    int   index2 = index1 + 1;
                    if (index2 < valueCollection.Count)
                    {
                        IExtendedDataValue extendedDataValue = valueCollection[index2];
                        switch (num)
                        {
                        case 3:
                            dimensionStyle.PostFix = ((DxfExtendedData.String)extendedDataValue).Value;
                            continue;

                        case 4:
                            dimensionStyle.AlternateDimensioningSuffix = ((DxfExtendedData.String)extendedDataValue).Value;
                            continue;

                        case 5:
                            string blockName1 = ((DxfExtendedData.String)extendedDataValue).Value;
                            if (!string.IsNullOrEmpty(blockName1))
                            {
                                dimensionStyle.ArrowBlock = Class309.smethod_1(modelBuilder, blockName1);
                                continue;
                            }
                            continue;

                        case 6:
                            string blockName2 = ((DxfExtendedData.String)extendedDataValue).Value;
                            if (!string.IsNullOrEmpty(blockName2))
                            {
                                dimensionStyle.FirstArrowBlock = Class309.smethod_1(modelBuilder, blockName2);
                                continue;
                            }
                            continue;

                        case 7:
                            string blockName3 = ((DxfExtendedData.String)extendedDataValue).Value;
                            if (!string.IsNullOrEmpty(blockName3))
                            {
                                dimensionStyle.SecondArrowBlock = Class309.smethod_1(modelBuilder, blockName3);
                                continue;
                            }
                            continue;

                        case 40:
                            dimensionStyle.ScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 41:
                            dimensionStyle.ArrowSize = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 42:
                            dimensionStyle.ExtensionLineOffset = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 43:
                            dimensionStyle.DimensionLineIncrement = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 44:
                            dimensionStyle.ExtensionLineExtension = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 45:
                            dimensionStyle.Rounding = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 46:
                            dimensionStyle.DimensionLineExtension = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 47:
                            dimensionStyle.PlusTolerance = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 48:
                            dimensionStyle.MinusTolerance = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 49:
                            dimensionStyle.FixedExtensionLineLength = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 50:
                            dimensionStyle.JoggedRadiusDimensionTransverseSegmentAngle = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 69:
                            dimensionStyle.TextBackgroundFillMode = (DimensionTextBackgroundFillMode)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 70:
                            dimensionStyle.TextBackgroundColor = Color.CreateFromColorIndex(((DxfExtendedData.Int16)extendedDataValue).Value);
                            continue;

                        case 71:
                            dimensionStyle.GenerateTolerances = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 72:
                            dimensionStyle.LimitsGeneration = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 73:
                            dimensionStyle.TextInsideHorizontal = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 74:
                            dimensionStyle.TextOutsideHorizontal = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 75:
                            dimensionStyle.SuppressFirstExtensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 76:
                            dimensionStyle.SuppressSecondExtensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 77:
                            dimensionStyle.TextVerticalAlignment = (DimensionTextVerticalAlignment)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 78:
                            dimensionStyle.ZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 79:
                            dimensionStyle.AngularZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 90:
                            dimensionStyle.ArcLengthSymbolPosition = (ArcLengthSymbolPosition)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 140:
                            dimensionStyle.TextHeight = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 141:
                            dimensionStyle.CenterMarkSize = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 142:
                            dimensionStyle.TickSize = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 143:
                            dimensionStyle.AlternateUnitScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 144:
                            dimensionStyle.LinearScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 145:
                            dimensionStyle.TextVerticalPosition = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 146:
                            dimensionStyle.ToleranceScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 147:
                            dimensionStyle.DimensionLineGap = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 148:
                            dimensionStyle.AlternateUnitRounding = ((DxfExtendedData.Double)extendedDataValue).Value;
                            continue;

                        case 170:
                            dimensionStyle.AlternateUnitDimensioning = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 171:
                            dimensionStyle.AlternateUnitDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 172:
                            dimensionStyle.TextOutsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 173:
                            dimensionStyle.SeparateArrowBlocks = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 174:
                            dimensionStyle.TextInsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 175:
                            dimensionStyle.SuppressOutsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 176:
                            short colorIndex1 = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            dimensionStyle.DimensionLineColor = Color.CreateFromColorIndex(colorIndex1);
                            continue;

                        case 177:
                            short colorIndex2 = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            dimensionStyle.ExtensionLineColor = Color.CreateFromColorIndex(colorIndex2);
                            continue;

                        case 178:
                            short colorIndex3 = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            dimensionStyle.TextColor = Color.CreateFromColorIndex(colorIndex3);
                            continue;

                        case 179:
                            dimensionStyle.AngularDimensionDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 271:
                            dimensionStyle.DecimalPlaces = Convert.ToInt16(extendedDataValue.ValueObject);
                            continue;

                        case 272:
                            dimensionStyle.ToleranceDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 273:
                            dimensionStyle.AlternateUnitFormat = (AlternateUnitFormat)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 274:
                            dimensionStyle.AlternateUnitToleranceDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 275:
                            dimensionStyle.AngularUnit = (AngularUnit)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 276:
                            dimensionStyle.FractionFormat = (FractionFormat)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 277:
                            dimensionStyle.LinearUnitFormat = (LinearUnitFormat)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 278:
                            dimensionStyle.DecimalSeparator = (char)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 279:
                            dimensionStyle.TextMovement = (TextMovement)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 280:
                            dimensionStyle.TextHorizontalAlignment = (DimensionTextHorizontalAlignment)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 281:
                            dimensionStyle.SuppressFirstDimensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 282:
                            dimensionStyle.SuppressSecondDimensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1;
                            continue;

                        case 283:
                            dimensionStyle.ToleranceAlignment = (ToleranceAlignment)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 284:
                            dimensionStyle.ToleranceZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 285:
                            dimensionStyle.AlternateUnitZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 286:
                            dimensionStyle.AlternateUnitToleranceZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 288:
                            dimensionStyle.CursorUpdate = (CursorUpdate)((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 290:
                            dimensionStyle.IsExtensionLineLengthFixed = ((DxfExtendedData.Int16)extendedDataValue).Value != (short)0;
                            continue;

                        case 340:
                            DxfTextStyle dxfTextStyle = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfTextStyle;
                            if (dxfTextStyle != null)
                            {
                                dimensionStyle.TextStyle = dxfTextStyle;
                                continue;
                            }
                            continue;

                        case 341:
                            DxfBlock dxfBlock1 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock;
                            if (dxfBlock1 != null)
                            {
                                dimensionStyle.LeaderArrowBlock = dxfBlock1;
                                continue;
                            }
                            continue;

                        case 342:
                            DxfBlock dxfBlock2 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock;
                            if (dxfBlock2 != null)
                            {
                                dimensionStyle.ArrowBlock = dxfBlock2;
                                continue;
                            }
                            continue;

                        case 343:
                            DxfBlock dxfBlock3 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock;
                            if (dxfBlock3 != null)
                            {
                                dimensionStyle.FirstArrowBlock = dxfBlock3;
                                continue;
                            }
                            continue;

                        case 344:
                            DxfBlock dxfBlock4 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock;
                            if (dxfBlock4 != null)
                            {
                                dimensionStyle.SecondArrowBlock = dxfBlock4;
                                continue;
                            }
                            continue;

                        case 345:
                            DxfLineType dxfLineType1 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType;
                            if (dxfLineType1 != null)
                            {
                                dimensionStyle.DimensionLineLineType = dxfLineType1;
                                continue;
                            }
                            continue;

                        case 346:
                            DxfLineType dxfLineType2 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType;
                            if (dxfLineType2 != null)
                            {
                                dimensionStyle.FirstExtensionLineLineType = dxfLineType2;
                                continue;
                            }
                            continue;

                        case 347:
                            DxfLineType dxfLineType3 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType;
                            if (dxfLineType3 != null)
                            {
                                dimensionStyle.SecondExtensionLineLineType = dxfLineType3;
                                continue;
                            }
                            continue;

                        case 371:
                            dimensionStyle.DimensionLineWeight = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        case 372:
                            dimensionStyle.ExtensionLineWeight = ((DxfExtendedData.Int16)extendedDataValue).Value;
                            continue;

                        default:
                            continue;
                        }
                    }
                }
                else
                {
                    modelBuilder.Messages.Add(new DxfMessage(DxfStatus.InvalidXDataValueType, Severity.Warning, "ValueType", (object)valueCollection[index1].GetType())
                    {
                        Parameters =
                        {
                            {
                                "ExpectedValueType",
                                (object)typeof(DxfExtendedData.Int16)
                            },
                            {
                                "Target",
                                (object)dimensionStyle
                            }
                        }
                    });
                    break;
                }
            }
        }
Exemplo n.º 4
0
 public DxfLeader(DxfDimensionStyle dimensionStyle)
 {
     this.dxfDimensionStyleOverrides_0 = new DxfDimensionStyleOverrides(dimensionStyle, dimensionStyle.Model);
 }
Exemplo n.º 5
0
 public DxfLeader(DxfModel model)
 {
     this.dxfDimensionStyleOverrides_0 = new DxfDimensionStyleOverrides(model.CurrentDimensionStyle, model);
 }
Exemplo n.º 6
0
 public DxfTolerance(DxfDimensionStyle dimensionStyle)
 {
     this.dxfDimensionStyleOverrides_0 = new DxfDimensionStyleOverrides(dimensionStyle, dimensionStyle.Model);
 }
Exemplo n.º 7
0
 public DxfTolerance(DxfModel model)
 {
     this.dxfDimensionStyleOverrides_0 = new DxfDimensionStyleOverrides(model.CurrentDimensionStyle, model);
 }