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.

ShapeItemAppendMetadata Method

Appends metadata key-value pairs to the shape information. I

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 AppendMetadata(
	IList<Tuple<string, string>> keyValPairs
)

Parameters

keyValPairs
Type: System.Collections.GenericIListTupleString, String
A list of the key-value pairs that define the metatadata to be added

Return Value

Type: Boolean
True on success. Will return false and not add any metadata if even one key is empty.
Examples
public void InsertAndAddMetadataTest()
{
    // NOTE: replace "[" and "]" with smaller than and larger than characters,
    // had to be done like this due to doxygen XML clashing with C# syntax 

    var polymesh = CreateSomeValidBrep();
    var shapeItem = new ShapeItem
    {
        Name = "TestFileName",
        ShapeFacetedBrep = polymesh,
        UpAxis = ShapeUpAxis.Z_Axis
    };

    shapeItem.Insert();

    var testPairs = new List [Tuple[string, string]]
        {
          new Tuple[string, string] ("TestTAG", "testval"),
          new Tuple[string, string] ("Volume", "1.01")
        };

   shapeItem.AppendMetadata(testPairs);
}
See Also