ShapeItemRename Method

Renames a shape in the shape catalog with the given shape name.

Namespace:  Tekla.Structures.Catalogs
Assembly:  Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2023.0.3
Syntax
public bool Rename(
	string newName
)

Parameters

newName
Type: SystemString
The new name.

Return Value

Type: Boolean
True on success. False if the new name is empty or duplicated as the current name, or other exceptions.
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
        result = shapeItem.Rename("RenamedCubeBrep");
        if (result)
        {
            result = shapeItem.Name.Equals("RenamedCubeBrep");
        }
     }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next