static void DrawBB(ViewBase DrawView, RectangleBoundingBox boundingBox, DrawingColors Color) { PointList points = new PointList(); points.Add(boundingBox.LowerLeft); points.Add(boundingBox.UpperLeft); points.Add(boundingBox.UpperRight); points.Add(boundingBox.LowerRight); Polygon MyPolygon = new Polygon(DrawView, points); MyPolygon.Attributes.Line.Color = Color; MyPolygon.Insert(); }
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.Bolt) { Tekla.Structures.Drawing.Bolt drawingBolt = (Tekla.Structures.Drawing.Bolt)drawingObjectEnum.Current; boltRepresentation = drawingBolt.Attributes.Representation; if (drawingBolt.Attributes.SymbolContainsAxis) { symbolContainsAxis = Bool.True; } else { symbolContainsAxis = Bool.False; } if (drawingBolt.Attributes.SymbolContainsHole) { symbolContainsHole = Bool.True; } else { symbolContainsHole = Bool.False; } colour = drawingBolt.Attributes.Color; } } } else if (drawingObjectEnum.GetSize() > 1) { boltRepresentation = new Bolt.Representation(); symbolContainsAxis = new Bool(); SymbolContainsHole = new Bool(); colour = new DrawingColors(); } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Symbol) { Tekla.Structures.Drawing.Symbol drawingSymbol = (Tekla.Structures.Drawing.Symbol)drawingObjectEnum.Current; angle = drawingSymbol.Attributes.Angle.ToString(); colour = drawingSymbol.Attributes.Color; frameColour = drawingSymbol.Attributes.Frame.Color; frameType = (FrameTypeEnum)Enum.Parse(typeof(FrameTypeEnum), drawingSymbol.Attributes.Frame.Type.ToString()); height = drawingSymbol.Attributes.Height.ToString(); insertionPoint = drawingSymbol.InsertionPoint; string placing = drawingSymbol.Placing.ToString().Replace("Tekla.Structures.Drawing.", ""); placingType = (PlacingTypeEnum)Enum.Parse(typeof(PlacingTypeEnum), placing); symbolFile = drawingSymbol.SymbolInfo.SymbolFile; symbolIndex = drawingSymbol.SymbolInfo.SymbolIndex.ToString(); } } } else if (drawingObjectEnum.GetSize() > 1) { angle = ""; colour = new DrawingColors(); frameColour = new DrawingColors(); frameType = new FrameTypeEnum(); height = ""; insertionPoint = null; placingType = new PlacingTypeEnum(); symbolFile = ""; symbolIndex = ""; } }
public static dynamic GetTSObject(DrawingColors dynEnum) { var tsType = TSActivator.CreateInstance("Tekla.Structures.Drawing.DrawingColors").GetType(); switch (dynEnum) { case DrawingColors.Gray30: return(System.Enum.Parse(tsType, "Gray30")); case DrawingColors.Gray50: return(System.Enum.Parse(tsType, "Gray50")); case DrawingColors.Gray70: return(System.Enum.Parse(tsType, "Gray70")); case DrawingColors.Gray90: return(System.Enum.Parse(tsType, "Gray90")); case DrawingColors.Invisible: return(System.Enum.Parse(tsType, "Invisible")); case DrawingColors.Black: return(System.Enum.Parse(tsType, "Black")); case DrawingColors.NewLine1: return(System.Enum.Parse(tsType, "NewLine1")); case DrawingColors.NewLine2: return(System.Enum.Parse(tsType, "NewLine2")); case DrawingColors.NewLine3: return(System.Enum.Parse(tsType, "NewLine3")); case DrawingColors.NewLine4: return(System.Enum.Parse(tsType, "NewLine4")); case DrawingColors.NewLine5: return(System.Enum.Parse(tsType, "NewLine5")); case DrawingColors.NewLine6: return(System.Enum.Parse(tsType, "NewLine6")); case DrawingColors.Red: return(System.Enum.Parse(tsType, "Red")); case DrawingColors.Green: return(System.Enum.Parse(tsType, "Green")); case DrawingColors.Blue: return(System.Enum.Parse(tsType, "Blue")); case DrawingColors.Cyan: return(System.Enum.Parse(tsType, "Cyan")); case DrawingColors.Yellow: return(System.Enum.Parse(tsType, "Yellow")); case DrawingColors.Magenta: return(System.Enum.Parse(tsType, "Magenta")); default: throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented"); } }
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.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.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 = ""; } }
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 = ""; } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part) { Tekla.Structures.Drawing.Part drawingPart = (Tekla.Structures.Drawing.Part)drawingObjectEnum.Current; if (drawingPart.Attributes.DrawCenterLine) { drawCenterLine = Bool.True; } else { drawCenterLine = Bool.False; } if (drawingPart.Attributes.DrawChamfers) { drawChamfers = Bool.True; } else { drawChamfers = Bool.False; } //drawConnectingSideMarks = drawingPart.Attributes.DrawConnectingSideMarks; if (drawingPart.Attributes.DrawHiddenLines) { drawHiddenLines = Bool.True; } else { drawHiddenLines = Bool.False; } if (drawingPart.Attributes.DrawOrientationMark) { drawOrientationMark = Bool.True; } else { drawOrientationMark = Bool.False; } if (drawingPart.Attributes.DrawOwnHiddenLines) { drawOwnHiddenLines = Bool.True; } else { drawOwnHiddenLines = Bool.False; } if (drawingPart.Attributes.DrawPopMarks) { drawPopMarks = Bool.True; } else { drawPopMarks = Bool.False; } if (drawingPart.Attributes.DrawReferenceLine) { drawReferenceLine = Bool.True; } else { drawReferenceLine = Bool.False; } visibleLinesColour = drawingPart.Attributes.VisibleLines.Color; if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot) { visibleLinesType = LineTypeEnum.DashDot; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDoubleDot) { visibleLinesType = LineTypeEnum.DashDoubleDot; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashedLine) { visibleLinesType = LineTypeEnum.DashedLine; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DottedLine) { visibleLinesType = LineTypeEnum.DottedLine; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashDash) { visibleLinesType = LineTypeEnum.SlashDash; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashedLine) { visibleLinesType = LineTypeEnum.SlashedLine; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SolidLine) { visibleLinesType = LineTypeEnum.SolidLine; } else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.UndefinedLine) { visibleLinesType = LineTypeEnum.UndefinedLine; } hiddenLinesColour = drawingPart.Attributes.HiddenLines.Color; if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDot) { hiddenLinesType = LineTypeEnum.DashDot; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDoubleDot) { hiddenLinesType = LineTypeEnum.DashDoubleDot; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashedLine) { hiddenLinesType = LineTypeEnum.DashedLine; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DottedLine) { hiddenLinesType = LineTypeEnum.DottedLine; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashDash) { hiddenLinesType = LineTypeEnum.SlashDash; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashedLine) { hiddenLinesType = LineTypeEnum.SlashedLine; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SolidLine) { hiddenLinesType = LineTypeEnum.SolidLine; } else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.UndefinedLine) { hiddenLinesType = LineTypeEnum.UndefinedLine; } referenceLinesColour = drawingPart.Attributes.ReferenceLine.Color; if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot) { visibleLinesType = LineTypeEnum.DashDot; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashDoubleDot) { referenceLinesType = LineTypeEnum.DashDoubleDot; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashedLine) { referenceLinesType = LineTypeEnum.DashedLine; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DottedLine) { referenceLinesType = LineTypeEnum.DottedLine; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashDash) { referenceLinesType = LineTypeEnum.SlashDash; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashedLine) { referenceLinesType = LineTypeEnum.SlashedLine; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SolidLine) { referenceLinesType = LineTypeEnum.SolidLine; } else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.UndefinedLine) { referenceLinesType = LineTypeEnum.UndefinedLine; } } } } else if (drawingObjectEnum.GetSize() > 1) { drawCenterLine = new Bool(); drawChamfers = new Bool(); drawHiddenLines = new Bool(); drawOrientationMark = new Bool(); drawOwnHiddenLines = new Bool(); DrawPopMarks = new Bool(); drawReferenceLine = new Bool(); visibleLinesColour = new DrawingColors(); visibleLinesType = new LineTypeEnum(); hiddenLinesColour = new DrawingColors(); hiddenLinesType = new LineTypeEnum(); referenceLinesColour = new DrawingColors(); referenceLinesType = new LineTypeEnum(); } }
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 = ""; } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part) { Tekla.Structures.Drawing.Part drawingPart = (Tekla.Structures.Drawing.Part)drawingObjectEnum.Current; if (drawingPart.Attributes.DrawCenterLine) drawCenterLine = Bool.True; else drawCenterLine = Bool.False; if (drawingPart.Attributes.DrawChamfers) drawChamfers = Bool.True; else drawChamfers = Bool.False; //drawConnectingSideMarks = drawingPart.Attributes.DrawConnectingSideMarks; if (drawingPart.Attributes.DrawHiddenLines) drawHiddenLines = Bool.True; else drawHiddenLines = Bool.False; if (drawingPart.Attributes.DrawOrientationMark) drawOrientationMark = Bool.True; else drawOrientationMark = Bool.False; if (drawingPart.Attributes.DrawOwnHiddenLines) drawOwnHiddenLines = Bool.True; else drawOwnHiddenLines = Bool.False; if (drawingPart.Attributes.DrawPopMarks) drawPopMarks = Bool.True; else drawPopMarks = Bool.False; if (drawingPart.Attributes.DrawReferenceLine) drawReferenceLine = Bool.True; else drawReferenceLine = Bool.False; visibleLinesColour = drawingPart.Attributes.VisibleLines.Color; if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot) visibleLinesType = LineTypeEnum.DashDot; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDoubleDot) visibleLinesType = LineTypeEnum.DashDoubleDot; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashedLine) visibleLinesType = LineTypeEnum.DashedLine; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DottedLine) visibleLinesType = LineTypeEnum.DottedLine; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashDash) visibleLinesType = LineTypeEnum.SlashDash; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashedLine) visibleLinesType = LineTypeEnum.SlashedLine; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SolidLine) visibleLinesType = LineTypeEnum.SolidLine; else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.UndefinedLine) visibleLinesType = LineTypeEnum.UndefinedLine; hiddenLinesColour = drawingPart.Attributes.HiddenLines.Color; if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDot) hiddenLinesType = LineTypeEnum.DashDot; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDoubleDot) hiddenLinesType = LineTypeEnum.DashDoubleDot; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashedLine) hiddenLinesType = LineTypeEnum.DashedLine; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DottedLine) hiddenLinesType = LineTypeEnum.DottedLine; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashDash) hiddenLinesType = LineTypeEnum.SlashDash; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashedLine) hiddenLinesType = LineTypeEnum.SlashedLine; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SolidLine) hiddenLinesType = LineTypeEnum.SolidLine; else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.UndefinedLine) hiddenLinesType = LineTypeEnum.UndefinedLine; referenceLinesColour = drawingPart.Attributes.ReferenceLine.Color; if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot) visibleLinesType = LineTypeEnum.DashDot; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashDoubleDot) referenceLinesType = LineTypeEnum.DashDoubleDot; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashedLine) referenceLinesType = LineTypeEnum.DashedLine; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DottedLine) referenceLinesType = LineTypeEnum.DottedLine; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashDash) referenceLinesType = LineTypeEnum.SlashDash; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashedLine) referenceLinesType = LineTypeEnum.SlashedLine; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SolidLine) referenceLinesType = LineTypeEnum.SolidLine; else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.UndefinedLine) referenceLinesType = LineTypeEnum.UndefinedLine; } } } else if (drawingObjectEnum.GetSize() > 1) { drawCenterLine = new Bool(); drawChamfers = new Bool(); drawHiddenLines = new Bool(); drawOrientationMark = new Bool(); drawOwnHiddenLines = new Bool(); DrawPopMarks = new Bool(); drawReferenceLine = new Bool(); visibleLinesColour = new DrawingColors(); visibleLinesType = new LineTypeEnum(); hiddenLinesColour = new DrawingColors(); hiddenLinesType = new LineTypeEnum(); referenceLinesColour = new DrawingColors(); referenceLinesType = new LineTypeEnum(); } }
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 = ""; } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Bolt) { Tekla.Structures.Drawing.Bolt drawingBolt = (Tekla.Structures.Drawing.Bolt)drawingObjectEnum.Current; boltRepresentation = drawingBolt.Attributes.Representation; if (drawingBolt.Attributes.SymbolContainsAxis) symbolContainsAxis = Bool.True; else symbolContainsAxis = Bool.False; if (drawingBolt.Attributes.SymbolContainsHole) symbolContainsHole = Bool.True; else symbolContainsHole = Bool.False; colour = drawingBolt.Attributes.Color; } } } else if (drawingObjectEnum.GetSize() > 1) { boltRepresentation = new Bolt.Representation(); symbolContainsAxis = new Bool(); SymbolContainsHole = new Bool(); colour = new DrawingColors(); } }