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: 2023.0.3
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