ShapeItemGetInstanceCount Method |
Get the number of instances used in the model of a shape
Namespace: Tekla.Structures.Catalogs
Assembly: Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
Examples
This sample shows how to call the GetInstanceCount method to detect shapes without instances thus can be removed.
public List<string> CheckShapeInstancesTest() { var shapeEnumerator = CatalogHandler.GetShapeItems(); var removedShapes = new List<String>(); shapeEnumerator.Reset(); while (shapeEnumerator.MoveNext()) { var shape = shapeEnumerator.Current; if (shape.GetInstanceCount() == 0) { removedShapes.Add(shape.Name); } } return removedShapes; }
See Also