public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Mark) { Tekla.Structures.Drawing.Mark drawingMark = (Tekla.Structures.Drawing.Mark)drawingObjectEnum.Current; frameColour = drawingMark.Attributes.Frame.Color; frameType = (FrameTypeEnum)Enum.Parse(typeof(FrameTypeEnum), drawingMark.Attributes.Frame.Type.ToString()); } } } else if (drawingObjectEnum.GetSize() > 1) { frameColour = new DrawingColors(); FrameType = new FrameTypeEnum(); } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.GridLine) { Tekla.Structures.Drawing.GridLine grid = (Tekla.Structures.Drawing.GridLine)drawingObjectEnum.Current; if (grid.Attributes.DrawOnlyTextLabelsNotGridLines) drawOnlyTextLabelsNotGridLines = Bool.True; else drawOnlyTextLabelsNotGridLines = Bool.False; if (grid.Attributes.DrawTextAtEndOfGridLine) drawTextAtEndOfGridLine = Bool.True; else drawTextAtEndOfGridLine = Bool.False; if (grid.Attributes.DrawTextAtStartOfGridLine) drawTextAtStartOfGridLine = Bool.True; else drawTextAtStartOfGridLine = Bool.False; if (grid.Attributes.Font.Bold) fontBold = Bool.True; else fontBold = Bool.False; fontColour = grid.Attributes.Font.Color; fontHeight = grid.Attributes.Font.Height.ToString(); if (grid.Attributes.Font.Italic) fontItalic = Bool.True; else fontItalic = Bool.False; fontName = grid.Attributes.Font.Name; frameColour = grid.Attributes.Frame.Color; if (grid.Attributes.Frame.Type == FrameTypes.Circle) frameType = FrameTypeEnum.Circle; else if (grid.Attributes.Frame.Type == FrameTypes.Diamond) frameType = FrameTypeEnum.Diamond; else if (grid.Attributes.Frame.Type == FrameTypes.Hexagon) frameType = FrameTypeEnum.Hexagon; else if (grid.Attributes.Frame.Type == FrameTypes.Line) frameType = FrameTypeEnum.Line; else if (grid.Attributes.Frame.Type == FrameTypes.None) frameType = FrameTypeEnum.None; else if (grid.Attributes.Frame.Type == FrameTypes.Rectangular) frameType = FrameTypeEnum.Rectangular; else if (grid.Attributes.Frame.Type == FrameTypes.Round) frameType = FrameTypeEnum.Round; else if (grid.Attributes.Frame.Type == FrameTypes.Sharpened) frameType = FrameTypeEnum.Sharpened; else if (grid.Attributes.Frame.Type == FrameTypes.Triangle) frameType = FrameTypeEnum.Triangle; lineColour = grid.Attributes.Line.Color; if (grid.Attributes.Line.Type == LineTypes.DashDot) lineType = LineTypeEnum.DashDot; else if (grid.Attributes.Line.Type == LineTypes.DashDoubleDot) lineType = LineTypeEnum.DashDoubleDot; else if (grid.Attributes.Line.Type == LineTypes.DashedLine) lineType = LineTypeEnum.DashedLine; else if (grid.Attributes.Line.Type == LineTypes.DottedLine) lineType = LineTypeEnum.DottedLine; else if (grid.Attributes.Line.Type == LineTypes.SlashDash) lineType = LineTypeEnum.SlashDash; else if (grid.Attributes.Line.Type == LineTypes.SlashedLine) lineType = LineTypeEnum.SlashedLine; else if (grid.Attributes.Line.Type == LineTypes.SolidLine) lineType = LineTypeEnum.SolidLine; else if (grid.Attributes.Line.Type == LineTypes.UndefinedLine) lineType = LineTypeEnum.UndefinedLine; offsetAtEndOfLine = grid.Attributes.OffsetAtEndOfLine.ToString(); offsetAtStartOfLine = grid.Attributes.OffsetAtStartOfLine.ToString(); gridLabelText = grid.EndLabel.GridLabelText; } } } if (drawingObjectEnum.GetSize() > 1) { drawOnlyTextLabelsNotGridLines = new Bool(); drawTextAtEndOfGridLine = new Bool(); drawTextAtStartOfGridLine = new Bool(); fontColour = new DrawingColors(); fontHeight = ""; fontBold = new Bool(); fontItalic = new Bool(); fontName = ""; frameColour = new DrawingColors(); frameType = new FrameTypeEnum(); lineColour = new DrawingColors(); lineType = new LineTypeEnum(); offsetAtEndOfLine = ""; offsetAtStartOfLine = ""; gridLabelText = ""; } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Text) { Tekla.Structures.Drawing.Text text = (Tekla.Structures.Drawing.Text)drawingObjectEnum.Current; Text.TextAttributes textAttributes = text.Attributes; if (textAttributes.PreferredPlacing.ToString() == "Tekla.Structures.Drawing.PointPlacingType") preferredPlacingType = PreferredPlacingEnum.PointPlacingType; else if (textAttributes.PreferredPlacing.ToString() == "Tekla.Structures.Drawing.LeaderLinePlacingType") preferredPlacingType = PreferredPlacingEnum.LeaderLinePlacingType; textString = text.TextString.Replace("\n", "¬"); fontColour = text.Attributes.Font.Color; fontHeight = text.Attributes.Font.Height.ToString(); fontName = text.Attributes.Font.Name; if (text.Attributes.Font.Bold) fontBold = Bool.True; else fontBold = Bool.False; if (text.Attributes.Font.Italic) fontItalic = Bool.True; else fontItalic = Bool.False; textAngle = text.Attributes.Angle.ToString(); if (text.Attributes.Alignment == Tekla.Structures.Drawing.TextAlignment.Center) textAlignment = TextAlignmentEnum.Center; else if (text.Attributes.Alignment == Tekla.Structures.Drawing.TextAlignment.Left) textAlignment = TextAlignmentEnum.Left; else if (text.Attributes.Alignment == Tekla.Structures.Drawing.TextAlignment.Right) textAlignment = TextAlignmentEnum.Right; if (text.Attributes.Frame.Type == FrameTypes.Circle) frameType = FrameTypeEnum.Circle; else if (text.Attributes.Frame.Type == FrameTypes.Diamond) frameType = FrameTypeEnum.Diamond; else if (text.Attributes.Frame.Type == FrameTypes.Hexagon) frameType = FrameTypeEnum.Hexagon; else if (text.Attributes.Frame.Type == FrameTypes.Line) frameType = FrameTypeEnum.Line; else if (text.Attributes.Frame.Type == FrameTypes.None) frameType = FrameTypeEnum.None; else if (text.Attributes.Frame.Type == FrameTypes.Rectangular) frameType = FrameTypeEnum.Rectangular; else if (text.Attributes.Frame.Type == FrameTypes.Round) frameType = FrameTypeEnum.Round; else if (text.Attributes.Frame.Type == FrameTypes.Sharpened) frameType = FrameTypeEnum.Sharpened; else if (text.Attributes.Frame.Type == FrameTypes.Triangle) frameType = FrameTypeEnum.Triangle; frameColour = text.Attributes.Frame.Color; if (text.Attributes.ArrowHead.Head == ArrowheadTypes.CircleArrow) arrowheadType = ArrowheadTypeEnum.CircleArrow; else if (text.Attributes.ArrowHead.Head == ArrowheadTypes.FilledArrow) arrowheadType = ArrowheadTypeEnum.FilledArrow; else if (text.Attributes.ArrowHead.Head == ArrowheadTypes.FilledCircleArrow) arrowheadType = ArrowheadTypeEnum.FilledCircleArrow; else if (text.Attributes.ArrowHead.Head == ArrowheadTypes.LineArrow) arrowheadType = ArrowheadTypeEnum.LineArrow; if (text.Attributes.ArrowHead.ArrowPosition == ArrowheadPositions.Both) arrowheadPosition = ArrowheadPositionEnum.Both; else if (text.Attributes.ArrowHead.ArrowPosition == ArrowheadPositions.End) arrowheadPosition = ArrowheadPositionEnum.End; else if (text.Attributes.ArrowHead.ArrowPosition == ArrowheadPositions.None) arrowheadPosition = ArrowheadPositionEnum.None; else if (text.Attributes.ArrowHead.ArrowPosition == ArrowheadPositions.Start) arrowheadPosition = ArrowheadPositionEnum.Start; arrowheadWidth = text.Attributes.ArrowHead.Width.ToString(); arrowheadHeight = text.Attributes.ArrowHead.Height.ToString(); } } } else if (drawingObjectEnum.GetSize() > 1) { preferredPlacingType = new PreferredPlacingEnum(); textString = ""; FontColour = new DrawingColors(); fontHeight = ""; fontName = ""; fontBold = new Bool(); fontItalic = new Bool(); textAngle = ""; textAlignment = new TextAlignmentEnum(); frameType = new FrameTypeEnum(); FrameColour = new DrawingColors(); arrowheadType = new ArrowheadTypeEnum(); arrowheadPosition = new ArrowheadPositionEnum(); arrowheadWidth = ""; arrowheadHeight = ""; } }