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.

GraphicsDrawer Class

The GraphicsDrawer class draws temporary graphics in the currently active rendered view in Tekla Structures.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.UIGraphicsDrawer

Namespace:  Tekla.Structures.Model.UI
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public sealed class GraphicsDrawer

The GraphicsDrawer type exposes the following members.

Constructors
  Name Description
Public method GraphicsDrawer
Creates a new graphics drawer instance.
Top
Methods
  Name Description
Public method DrawLineSegment(LineSegment, Color)
Draws a temporary line segment in the currently active rendered view.
Public method DrawLineSegment(Point, Point, Color)
Draws a temporary line segment in the currently active rendered view.
Public method DrawMeshLines
Draws the mesh lines as temporary graphics in the currently active Tekla Structures rendered view.
Public method DrawMeshSurface
Draws the mesh surface as temporary graphics in the currently active Tekla Structures rendered view. The counterclockwise sides of the mesh triangles are drawn.
Public method DrawPolyLine
Draw a temporary polyline into all open Tekla Structures views.
Public method DrawText
Draws a temporary text in the currently active rendered view.
Public method RemoveTemporaryGraphicsObject
Remove a temporary graphic object from all views.
Public method RemoveTemporaryGraphicsObjects
Remove a list of temporary graphic objects from all views.
Top
Examples
using Tekla.Structures.Model.UI;
using Tekla.Structures.Geometry3d;

public class Example
{
       public void Example1()
       {
           GraphicsDrawer drawer = new GraphicsDrawer();

           drawer.DrawText(new Point(0.0, 1000.0, 1000.0), "TEXT SAMPLE", new Color(1.0, 0.5, 0.0));
           drawer.DrawLineSegment(new Point(0.0, 0.0, 0.0), new Point(1000.0, 1000.0, 1000.0), new Color(1.0, 0.0, 0.0));

           Mesh mesh = new Mesh();
           mesh.AddPoint(new Point(   0.0,    0.0, 0.0));
           mesh.AddPoint(new Point(1000.0,    0.0, 0.0));
           mesh.AddPoint(new Point(1000.0, 1000.0, 0.0));
           mesh.AddPoint(new Point(   0.0, 1000.0, 0.0));
           mesh.AddTriangle(0,1,2);
           mesh.AddTriangle(0,2,3);
           mesh.AddLine(0,1); mesh.AddLine(1,2); mesh.AddLine(2,3); mesh.AddLine(3,1);

           drawer.DrawMeshSurface(mesh, new Color(1.0, 0.0, 0.0, 0.5));
           drawer.DrawMeshLines(mesh, new Color(0.0, 0.0, 1.0));
       }
}
See Also