Tekla Open API

Detailed and full API reference helps you master Tekla Open API

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

DrawingCoordinateConverter Class

The DrawingCoordinateConverter class is used to move coordinates from one view to another. This tool takes into account the empty areas in the views.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Drawing.ToolsDrawingCoordinateConverter

Namespace:  Tekla.Structures.Drawing.Tools
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public class DrawingCoordinateConverter

The DrawingCoordinateConverter type exposes the following members.

Constructors
  Name Description
Public method DrawingCoordinateConverter
Initializes a new instance of the DrawingCoordinateConverter class
Top
Methods
  Name Description
Public methodStatic member Convert(ViewBase, ViewBase, PointList)
Converts a list of coordinate points from one view's coordinate system to another view's coordinate system.
Public methodStatic member Convert(ViewBase, ViewBase, Point)
Converts one coordinate point from one view's coordinate system to another view's coordinate system.
Top
Examples
In the following example a similar polygon is drawn to a view and to a sheet:
using Tekla.Structures.Drawing;
using Tekla.Structures.Drawing.Tools;
using Tekla.Structures.Geometry3d;

public class Example
{
       public void Example1()
       {
           DrawingHandler DrawingHandler = new DrawingHandler();

           ViewBase sheet = DrawingHandler.GetActiveDrawing().GetSheet();

           DrawingObjectEnumerator Views = sheet.GetAllObjects(typeof(View));

           Views.MoveNext();
           View myView = Views.Current as View;

           PointList PointsInView = new PointList();
           PointsInView.Add(new Point(0, 0));
           PointsInView.Add(new Point(100, 0));
           PointsInView.Add(new Point(100, 100));
           Polygon polygonInView = new Polygon(myView, PointsInView);
           polygonInView.Insert();
           PointList PointsInSheet = DrawingCoordinateConverter.Convert(myView, sheet, PointsInView);
           Polygon polygon = new Polygon(sheet, PointsInSheet);
           polygon.Insert();
       }
}
See Also