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.

WeldGeometry Class

Class that represents weld seam specific geometry.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.WeldingWeldGeometry

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

The WeldGeometry type exposes the following members.

Properties
  Name Description
Public property Polygons
Gets the weld seam specific ArrayList of Polygon objects.
Public property Position
Gets the weld seam position (above or below).
Top
Examples
using System.Collections;
using System.Text;
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Model;
using Tekla.Structures.Model.Welding;

public class Example
{
   private static Model _teklaModel;

   private Model TeklaModel
   {
        get
        {
            if (_teklaModel == null)
            {
                _teklaModel = new Model();
            }

            return _teklaModel;
        }
   }

   public void Example1()
   {
        ModelObjectEnumerator weldEnumerator =
         TeklaModel.GetModelObjectSelector().GetAllObjectsWithType(ModelObject.ModelObjectEnum.WELD);

        Weld weld = null;

        while (weldEnumerator.MoveNext())
        {
            weld = weldEnumerator.Current as Weld;

            if (weld != null)
            {
                break;
            }
        }

        if (weld != null)
        {
            ArrayList weldGeometries = weld.GetWeldGeometries();
            StringBuilder sb = new StringBuilder();

            foreach (WeldGeometry weldGeometry in weldGeometries)
            {
                if (weldGeometry != null)
                {
                    int polygonIndex = 1;

                    sb.AppendLine(weldGeometry.Position.ToString());

                    foreach (Polygon polygon in weldGeometry.Polygons)
                    {
                        if (polygon != null)
                        {
                           sb.AppendLine("Polygon: " + polygonIndex);

                           if (polygon.Points != null)
                           {
                               foreach (Point point in polygon.Points)
                               {
                                   if (point != null)
                                   { 
                                       sb.AppendLine(point.ToString());
                                   }
                               }                                    
                           }
                        }

                        polygonIndex++;
                    }
                }

                sb.AppendLine();
                sb.AppendLine();
            }
            // Print the string builder content to the desired place by calling sb.ToString();
        }
   }
}
See Also