public void GetProperties()
            {
                DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected();
                if (drawingObjectEnum.GetSize() == 1)
                {
                    while (drawingObjectEnum.MoveNext())
                    {
                        if (drawingObjectEnum.Current is Tekla.Structures.Drawing.StraightDimensionSet)
                        {
                            Tekla.Structures.Drawing.StraightDimensionSet straightDim = (Tekla.Structures.Drawing.StraightDimensionSet)drawingObjectEnum.Current;
                            dimensionType = straightDim.Attributes.DimensionType;
                            if (straightDim.Attributes.ShortDimension == DimensionSetBaseAttributes.ShortDimensionTypes.Inside) shortDimensionType = ShortDimensionEnum.Inside;
                            else shortDimensionType = ShortDimensionEnum.Outside;

                            if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Automatic) dimensionUnits = DimensionUnitsEnum.Automatic;
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Centimeter) dimensionUnits = DimensionUnitsEnum.Centimeter;
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Inch) dimensionUnits = DimensionUnitsEnum.Inch;
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Meter) dimensionUnits = DimensionUnitsEnum.Meter;
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Millimeter) dimensionUnits = DimensionUnitsEnum.Millimeter;

                            colour = straightDim.Attributes.Color;
                            fontName = straightDim.Attributes.Text.Font.Name;
                            fontHeight = straightDim.Attributes.Text.Font.Height.ToString();
                            fontColour = straightDim.Attributes.Text.Font.Color;
                            if (straightDim.Attributes.Text.Font.Italic) fontItalic = Bool.True; else fontItalic = Bool.False;
                            if (straightDim.Attributes.Text.Font.Bold) fontBold = Bool.True; else fontBold = Bool.False;
                            if (straightDim.Attributes.Placing.Placing == DimensionSetBaseAttributes.Placings.Free) placing = PlacingEnum.Free;
                            else placing = PlacingEnum.Fixed;

                            if (straightDim.Attributes.Placing.Direction.Negative) placingDirectionNegative = Bool.True; else placingDirectionNegative = Bool.False;
                            if (straightDim.Attributes.Placing.Direction.Positive) placingDirectionPositive = Bool.True; else placingDirectionPositive = Bool.False;
                            minimalDistance = straightDim.Attributes.Placing.Distance.MinimalDistance.ToString();
                            searchMargin = straightDim.Attributes.Placing.Distance.SearchMargin.ToString();
                        }
                    }
                }
                else if (drawingObjectEnum.GetSize() > 1)
                {
                    dimensionType = new DimensionSetBaseAttributes.DimensionTypes();
                    shortDimensionType = new ShortDimensionEnum();
                    dimensionUnits = new DimensionUnitsEnum();
                    colour = new DrawingColors();
                    fontName = "";
                    fontHeight = "";
                    fontColour = new DrawingColors();
                    fontItalic = new Bool();
                    fontBold = new Bool();
                    placing = new PlacingEnum();
                    placingDirectionNegative = new Bool();
                    placingDirectionPositive = new Bool();
                    minimalDistance = "";
                    searchMargin = "";
                }
            }
예제 #2
0
            public void GetProperties()
            {
                DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected();

                if (drawingObjectEnum.GetSize() == 1)
                {
                    while (drawingObjectEnum.MoveNext())
                    {
                        if (drawingObjectEnum.Current is Tekla.Structures.Drawing.StraightDimensionSet)
                        {
                            Tekla.Structures.Drawing.StraightDimensionSet straightDim = (Tekla.Structures.Drawing.StraightDimensionSet)drawingObjectEnum.Current;
                            dimensionType = straightDim.Attributes.DimensionType;
                            if (straightDim.Attributes.ShortDimension == DimensionSetBaseAttributes.ShortDimensionTypes.Inside)
                            {
                                shortDimensionType = ShortDimensionEnum.Inside;
                            }
                            else
                            {
                                shortDimensionType = ShortDimensionEnum.Outside;
                            }

                            if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Automatic)
                            {
                                dimensionUnits = DimensionUnitsEnum.Automatic;
                            }
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Centimeter)
                            {
                                dimensionUnits = DimensionUnitsEnum.Centimeter;
                            }
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Inch)
                            {
                                dimensionUnits = DimensionUnitsEnum.Inch;
                            }
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Meter)
                            {
                                dimensionUnits = DimensionUnitsEnum.Meter;
                            }
                            else if (straightDim.Attributes.Format.Unit == DimensionSetBaseAttributes.DimensionValueUnits.Millimeter)
                            {
                                dimensionUnits = DimensionUnitsEnum.Millimeter;
                            }

                            colour     = straightDim.Attributes.Color;
                            fontName   = straightDim.Attributes.Text.Font.Name;
                            fontHeight = straightDim.Attributes.Text.Font.Height.ToString();
                            fontColour = straightDim.Attributes.Text.Font.Color;
                            if (straightDim.Attributes.Text.Font.Italic)
                            {
                                fontItalic = Bool.True;
                            }
                            else
                            {
                                fontItalic = Bool.False;
                            }
                            if (straightDim.Attributes.Text.Font.Bold)
                            {
                                fontBold = Bool.True;
                            }
                            else
                            {
                                fontBold = Bool.False;
                            }
                            if (straightDim.Attributes.Placing.Placing == DimensionSetBaseAttributes.Placings.Free)
                            {
                                placing = PlacingEnum.Free;
                            }
                            else
                            {
                                placing = PlacingEnum.Fixed;
                            }

                            if (straightDim.Attributes.Placing.Direction.Negative)
                            {
                                placingDirectionNegative = Bool.True;
                            }
                            else
                            {
                                placingDirectionNegative = Bool.False;
                            }
                            if (straightDim.Attributes.Placing.Direction.Positive)
                            {
                                placingDirectionPositive = Bool.True;
                            }
                            else
                            {
                                placingDirectionPositive = Bool.False;
                            }
                            minimalDistance = straightDim.Attributes.Placing.Distance.MinimalDistance.ToString();
                            searchMargin    = straightDim.Attributes.Placing.Distance.SearchMargin.ToString();
                        }
                    }
                }
                else if (drawingObjectEnum.GetSize() > 1)
                {
                    dimensionType            = new DimensionSetBaseAttributes.DimensionTypes();
                    shortDimensionType       = new ShortDimensionEnum();
                    dimensionUnits           = new DimensionUnitsEnum();
                    colour                   = new DrawingColors();
                    fontName                 = "";
                    fontHeight               = "";
                    fontColour               = new DrawingColors();
                    fontItalic               = new Bool();
                    fontBold                 = new Bool();
                    placing                  = new PlacingEnum();
                    placingDirectionNegative = new Bool();
                    placingDirectionPositive = new Bool();
                    minimalDistance          = "";
                    searchMargin             = "";
                }
            }