API Reference

Detailed and full API reference helps you master Tekla development

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

ProfileItemGetCrossSection Method

Returns list of cross section points of inner surfaces from the profile item.

Namespace:  Tekla.Structures.Catalogs
Assembly:  Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2020.0.0.0 (2020.0.55582.0)
Syntax
public CrossSection GetCrossSection(
	double RelativeLocation = 0
)

Parameters

RelativeLocation (Optional)
Type: SystemDouble
The relative location of the cross section, values between 0 (start of profile) and 1 (end of profile).

Return Value

Type: CrossSection
List of inner cross section point lists on success, null on failure.
Examples
using System;
using Tekla.Structures.Catalogs;
using Tekla.Structures.Geometry3d;

public class Example
{
    public void Example1()
    {
        LibraryProfileItem item = new LibraryProfileItem();

        if (item.Select("HEA100"))
        {
            var section = item.GetCrossSection();
            if(section != null)
            {
                var outerSurface = section.OuterSurface;
                if(outerSurface != null)
                {
                    foreach (CrossSectionPoint point in outerSurface)
                    {
                        Console.WriteLine("Point " + string.Format("({0:0.000}, {1:0.000}, {2:0.000})", point.X, point.Y, point.Z));
                        Console.WriteLine("Chamfer type " + point.Chamfer.Type.ToString());
                        Console.WriteLine("Chamfer " + string.Format("({0:0.000}, {1:0.000}, {2:0.000}, {3:0.000})", point.Chamfer.X, point.Chamfer.Y, point.Chamfer.DZ1, point.Chamfer.DZ2));
                    }

                    var  outerSurfacePoints = section.OuterSurfacePoints;
                    if (outerSurfacePoints != null)
                    {
                        foreach (Point p in outerSurfacePoints)
                        {
                            Console.WriteLine("Point " + string.Format("({0:0.000}, {1:0.000}, {2:0.000})", p.X, p.Y, p.Z));
                        }
                    }
                }

                Console.WriteLine("HEA100 cross section points selected successfully");
            }
        }
    }
}
See Also