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.

Meta.Microsoft.Help.Id
M:Tekla.Structures.Catalogs.ShapeItem.Insert

ShapeItemInsert Method

Inserts a shape to the shape catalog based on the shape geometry.

Namespace:  Tekla.Structures.Catalogs
Assembly:  Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2020.0.0.0 (2020.0.55582.0)
Syntax
public bool Insert()

Return Value

Type: Boolean
Return true on success.
Examples
using System;
using Tekla.Structures.Catalogs;

public class Example
{
       public void InsertSimpleCube()
       {
         var vertices = new[]
         {
            new Vector(  0.0,   0.0,   0.0), // 0
            new Vector(300.0,   0.0,   0.0), // 1
            new Vector(300.0, 300.0,   0.0), // 2
            new Vector(  0.0, 300.0,   0.0), // 3
            new Vector(  0.0,   0.0, 300.0), // 4
            new Vector(300.0,   0.0, 300.0), // 5
            new Vector(300.0, 300.0, 300.0), // 6
            new Vector(  0.0, 300.0, 300.0), // 7
        };
        var outloop = new[] { new[] { 0, 3, 2, 1 },
                      new[] { 0, 1, 5, 4 },
                      new[] { 1, 2, 6, 5 },
                      new[] { 2, 3, 7, 6 },
                      new[] { 3, 0, 4, 7 },
                      new[] { 4, 5, 6, 7 }};

        var innerLoop = new Dictionary{int, int[][]}
        {
        };

        var brep = new FacetedBrep(vertices, outloop, innerLoop);
        var shapeItem = new ShapeItem
        {
            Name = "MyNiceCubeBrep",
            ShapeFacetedBrep = brep,
            UpAxis = ShapeUpAxis.Z_Axis
        };
        var result = shapeItem.Insert();
     }
}
See Also