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: 2026.0.0-alpha00057080+93cd22c410a086ecc356b7088d4daaf2e12907eb
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; }