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: 2025.0.0-alpha00045580+dc02c3918546f1e94eb2d3b13ea99057fb3313e0
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; }