ReadonlyidReadonlyobjectThe number of BimIfcObject instances using this class.
ReadonlyobjectsThe number of instances where BimIfcObject.hasGeometry is true and using this class.
ReadonlyreferencedThe set of disciplines with ifcproducts that have references to this class.
ReadonlyspatialReadonlytypeStatic ReadonlypredefinedRepresents all known IFC classes. These classes can be used with the is operator to check if an object belongs to a specific IFC class. They can also be used to create user interface lists or perform other operations related to IFC classes. However, to determine the actual classes in use for the currently loaded IFC files, refer to BimCoreApi.ifc.classes.
Gets an array of all disciplines with ifcproducts that have references to this class.
Adds a referenced discipline to the set of referenced disciplines.
The discipline to add.
Checks if the current instance is of the specified class (ModelProductClass, PredefinedIfcClassId) or type (ModelProductClassType).
The class or type to check against.
true if the current instance is of the specified class or type, false otherwise.
If you wish to peform the check with a string and it might not be one of the PredefinedIfcClassId. Then you can always fall back to comparing against id directly. However remember that such a comparison is case sensitive.
// Fastest
function checkIfBuildingStorey(o: BimIfcObject): boolean {
return o.class.is(ModelProductClass.predefined.buildingStorey);
}
// Fast. Check if type/category is 'walls' (IfcClassType)
function checkIfWallsType(o: BimIfcObject): boolean {
return o.class.is('walls');
}
// Slowest but still fast enough for many use cases
function checkIfBuildingStorey(o: BimIfcObject): boolean {
return o.class.is('IfcBuildingStorey'); // Compare using PredefinedIfcClassId
}
StaticclearClears the internal instance cache. After calling this, subsequent calls to getOrAdd will create new instances. Existing references to previously cached instances remain valid but will no longer be returned by getOrAdd.
Use this in server-side scenarios where multiple models are processed sequentially to prevent unbounded cache growth.
StaticgetRetrieves an instance of ModelProductClass based on the provided id. Lookup is case insensitive.
Given the same id then the same instance is always returned. The instance is cached and reused up until
reset after that new instances are created, cached and reused, until the next call to reset etc.
If the instance does not exist in the cache, a new instance is created and added to the cache.
The id of the ModelProductClass to retrieve or add to the cache. The id is case insensitive.
The ModelProductClass instance associated with the provided id.
StaticisChecks if the given string looks like valid ID for a class (format is IfcXxx).
The string to check.
true if the string is a valid class ID, false otherwise.
StaticparseParse a id string and retrieves the corresponding ModelProductClass instance. Parsing is case insensitive. Given the same id then the same instance is always returned. The instance is cached and reused up until reset after that new instances are created, cached and reused, until the next call to reset etc. If the instance does not exist in the cache, a new instance is created and added to the cache.
The id of the ModelProductClass to retrieve or add to the cache. The id is case insensitive.
The ModelProductClass instance associated with the provided id.
StaticresetResets to the original state. referencedDisciplinesSet is cleared. objectCount and objectsWithGeometryCount are set to 0.
Represents class (IfcWindow, IfcWall etc) There is one instance of this class for each unique IFC class. Therefore reference equality can be used to compare instances.
Example
```typescript` ModelProductClass.getOrAdd("IfcWindow") === ModelProductClass.predefined.window; // true ModelProductClass.ifcBuildingStorey === ModelProductClass.getOrAdd("IfcBuildingStorey"); // true ``