Skip to main content

ModelProductClass

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 ``

Index

Properties

readonlyid

id: string

readonlyobjectCount

objectCount: number

The number of BimIfcObject instances using this class.

readonlyobjectsWithGeometryCount

objectsWithGeometryCount: number

The number of instances where BimIfcObject.hasGeometry is true and using this class.

readonlyreferencedDisciplinesSet

referencedDisciplinesSet: DeepImmutableObject<Set<Discipline>>

The set of disciplines with ifcproducts that have references to this class.

readonlyspatialRole

spatialRole: SpatialRole

readonlytype

type: floor | beam | other | columns | covering | walls | doors | flow | furniture | reinforcement | roof | space | stairs | windows | annotations

staticreadonlypredefined

predefined: Readonly<Record<PredefinedClassIdWithoutPrefix, ModelProductClass>>

Represents 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.

@example
function checkIfBuildingStorey(o: BimIfcObject): boolean {
return o.class.is(ModelProductClass.predefined.buildingStorey);
}

Accessors

referencedDisciplines

  • get referencedDisciplines(): DeepImmutableObject<Discipline>[]
  • Gets an array of all disciplines with ifcproducts that have references to this class.


    Returns DeepImmutableObject<Discipline>[]

Methods

addReferencedClass

  • Adds a referenced discipline to the set of referenced disciplines.


    Parameters

    Returns void

is

  • is(c: ModelProductClass | floor | beam | other | columns | covering | walls | doors | flow | furniture | reinforcement | roof | space | stairs | windows | annotations | IfcActuator | IfcAirTerminal | IfcAirTerminalBox | IfcAirToAirHeatRecovery | IfcAlarm | IfcAlignment | IfcAlignmentCant | IfcAlignmentHorizontal | IfcAlignmentSegment | IfcAlignmentVertical | IfcAnnotation | IfcAudioVisualAppliance | IfcBeam | IfcBeamStandardCase | IfcBearing | IfcBoiler | IfcBorehole | IfcBridge | IfcBridgePart | IfcBuilding | IfcBuildingElementPart | IfcBuildingElementProxy | IfcBuildingStorey | IfcBuiltElement | IfcBurner | IfcCableCarrierFitting | IfcCableCarrierSegment | IfcCableFitting | IfcCableSegment | IfcCaissonFoundation | IfcChamferEdgeFeature | IfcChiller | IfcChimney | IfcCivilElement | IfcCoil | IfcColumn | IfcColumnStandardCase | IfcCommunicationsAppliance | IfcCompressor | IfcCondenser | IfcController | IfcConveyorSegment | IfcCooledBeam | IfcCoolingTower | IfcCourse | IfcCovering | IfcCurtainWall | IfcDamper | IfcDeepFoundation | IfcDiscreteAccessory | IfcDistributionBoard | IfcDistributionChamberElement | IfcDistributionControlElement | IfcDistributionElement | IfcDistributionFlowElement | IfcDistributionPort | IfcDoor | IfcDoorStandardCase | IfcDuctFitting | IfcDuctSegment | IfcDuctSilencer | IfcEarthworksCut | IfcEarthworksElement | IfcEarthworksFill | IfcElectricalElement | IfcElectricAppliance | IfcElectricDistributionBoard | IfcElectricDistributionPoint | IfcElectricFlowStorageDevice | IfcElectricFlowTreatmentDevice | IfcElectricGenerator | IfcElectricMotor | IfcElectricTimeControl | IfcElementAssembly | IfcEnergyConversionDevice | IfcEngine | IfcEquipmentElement | IfcEvaporativeCooler | IfcEvaporator | IfcExternalSpatialElement | IfcFacility | IfcFacilityPartCommon | IfcFan | IfcFastener | IfcFilter | IfcFireSuppressionTerminal | IfcFlowController | IfcFlowFitting | IfcFlowInstrument | IfcFlowMeter | IfcFlowMovingDevice | IfcFlowSegment | IfcFlowStorageDevice | IfcFlowTerminal | IfcFlowTreatmentDevice | IfcFooting | IfcFurnishingElement | IfcFurniture | IfcGeographicElement | IfcGeomodel | IfcGeoslice | IfcGeotechnicalStratum | IfcGrid | IfcHeatExchanger | IfcHumidifier | IfcImpactProtectionDevice | IfcInterceptor | IfcJunctionBox | IfcKerb | IfcLamp | IfcLightFixture | IfcLinearElement | IfcLinearPositioningElement | IfcLiquidTerminal | IfcMarineFacility | IfcMarinePart | IfcMechanicalFastener | IfcMedicalDevice | IfcMember | IfcMemberStandardCase | IfcMobileTelecommunicationsAppliance | IfcMooringDevice | IfcMotorConnection | IfcNavigationElement | IfcOpeningElement | IfcOpeningStandardCase | IfcOutlet | IfcPavement | IfcPile | IfcPipeFitting | IfcPipeSegment | IfcPlate | IfcPlateStandardCase | IfcProject | IfcProjectionElement | IfcProtectiveDevice | IfcProtectiveDeviceTrippingUnit | IfcProxy | IfcPump | IfcRail | IfcRailing | IfcRailway | IfcRailwayPart | IfcRamp | IfcRampFlight | IfcReferent | IfcReinforcedSoil | IfcReinforcingBar | IfcReinforcingMesh | IfcRoad | IfcRoadPart | IfcRoof | IfcRoundedEdgeFeature | IfcSanitaryTerminal | IfcSensor | IfcShadingDevice | IfcSign | IfcSignal | IfcSite | IfcSlab | IfcSlabElementedCase | IfcSlabStandardCase | IfcSolarDevice | IfcSpace | IfcSpaceHeater | IfcSpatialZone | IfcStackTerminal | IfcStair | IfcStairFlight | IfcStructuralCurveAction | IfcStructuralCurveConnection | IfcStructuralCurveMember | IfcStructuralCurveMemberVarying | IfcStructuralCurveReaction | IfcStructuralLinearAction | IfcStructuralLinearActionVarying | IfcStructuralPlanarAction | IfcStructuralPlanarActionVarying | IfcStructuralPointAction | IfcStructuralPointConnection | IfcStructuralPointReaction | IfcStructuralSurfaceAction | IfcStructuralSurfaceConnection | IfcStructuralSurfaceMember | IfcStructuralSurfaceMemberVarying | IfcStructuralSurfaceReaction | IfcSurfaceFeature | IfcSwitchingDevice | IfcSystemFurnitureElement | IfcTank | IfcTendon | IfcTendonAnchor | IfcTendonConduit | IfcTrackElement | IfcTransformer | IfcTransportElement | IfcTubeBundle | IfcUnitaryControlElement | IfcUnitaryEquipment | IfcUnknown | IfcValve | IfcVehicle | IfcVibrationDamper | IfcVibrationIsolator | IfcVirtualElement | IfcVoidingFeature | IfcWall | IfcWallElementedCase | IfcWallStandardCase | IfcWasteTerminal | IfcWindow | IfcWindowStandardCase): boolean
  • Checks if the current instance is of the specified class (ModelProductClass, PredefinedIfcClassId) or type (ModelProductClassType).

    @remarks

    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.

    @example
    // 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
    }

    Parameters

    • c: ModelProductClass | floor | beam | other | columns | covering | walls | doors | flow | furniture | reinforcement | roof | space | stairs | windows | annotations | IfcActuator | IfcAirTerminal | IfcAirTerminalBox | IfcAirToAirHeatRecovery | IfcAlarm | IfcAlignment | IfcAlignmentCant | IfcAlignmentHorizontal | IfcAlignmentSegment | IfcAlignmentVertical | IfcAnnotation | IfcAudioVisualAppliance | IfcBeam | IfcBeamStandardCase | IfcBearing | IfcBoiler | IfcBorehole | IfcBridge | IfcBridgePart | IfcBuilding | IfcBuildingElementPart | IfcBuildingElementProxy | IfcBuildingStorey | IfcBuiltElement | IfcBurner | IfcCableCarrierFitting | IfcCableCarrierSegment | IfcCableFitting | IfcCableSegment | IfcCaissonFoundation | IfcChamferEdgeFeature | IfcChiller | IfcChimney | IfcCivilElement | IfcCoil | IfcColumn | IfcColumnStandardCase | IfcCommunicationsAppliance | IfcCompressor | IfcCondenser | IfcController | IfcConveyorSegment | IfcCooledBeam | IfcCoolingTower | IfcCourse | IfcCovering | IfcCurtainWall | IfcDamper | IfcDeepFoundation | IfcDiscreteAccessory | IfcDistributionBoard | IfcDistributionChamberElement | IfcDistributionControlElement | IfcDistributionElement | IfcDistributionFlowElement | IfcDistributionPort | IfcDoor | IfcDoorStandardCase | IfcDuctFitting | IfcDuctSegment | IfcDuctSilencer | IfcEarthworksCut | IfcEarthworksElement | IfcEarthworksFill | IfcElectricalElement | IfcElectricAppliance | IfcElectricDistributionBoard | IfcElectricDistributionPoint | IfcElectricFlowStorageDevice | IfcElectricFlowTreatmentDevice | IfcElectricGenerator | IfcElectricMotor | IfcElectricTimeControl | IfcElementAssembly | IfcEnergyConversionDevice | IfcEngine | IfcEquipmentElement | IfcEvaporativeCooler | IfcEvaporator | IfcExternalSpatialElement | IfcFacility | IfcFacilityPartCommon | IfcFan | IfcFastener | IfcFilter | IfcFireSuppressionTerminal | IfcFlowController | IfcFlowFitting | IfcFlowInstrument | IfcFlowMeter | IfcFlowMovingDevice | IfcFlowSegment | IfcFlowStorageDevice | IfcFlowTerminal | IfcFlowTreatmentDevice | IfcFooting | IfcFurnishingElement | IfcFurniture | IfcGeographicElement | IfcGeomodel | IfcGeoslice | IfcGeotechnicalStratum | IfcGrid | IfcHeatExchanger | IfcHumidifier | IfcImpactProtectionDevice | IfcInterceptor | IfcJunctionBox | IfcKerb | IfcLamp | IfcLightFixture | IfcLinearElement | IfcLinearPositioningElement | IfcLiquidTerminal | IfcMarineFacility | IfcMarinePart | IfcMechanicalFastener | IfcMedicalDevice | IfcMember | IfcMemberStandardCase | IfcMobileTelecommunicationsAppliance | IfcMooringDevice | IfcMotorConnection | IfcNavigationElement | IfcOpeningElement | IfcOpeningStandardCase | IfcOutlet | IfcPavement | IfcPile | IfcPipeFitting | IfcPipeSegment | IfcPlate | IfcPlateStandardCase | IfcProject | IfcProjectionElement | IfcProtectiveDevice | IfcProtectiveDeviceTrippingUnit | IfcProxy | IfcPump | IfcRail | IfcRailing | IfcRailway | IfcRailwayPart | IfcRamp | IfcRampFlight | IfcReferent | IfcReinforcedSoil | IfcReinforcingBar | IfcReinforcingMesh | IfcRoad | IfcRoadPart | IfcRoof | IfcRoundedEdgeFeature | IfcSanitaryTerminal | IfcSensor | IfcShadingDevice | IfcSign | IfcSignal | IfcSite | IfcSlab | IfcSlabElementedCase | IfcSlabStandardCase | IfcSolarDevice | IfcSpace | IfcSpaceHeater | IfcSpatialZone | IfcStackTerminal | IfcStair | IfcStairFlight | IfcStructuralCurveAction | IfcStructuralCurveConnection | IfcStructuralCurveMember | IfcStructuralCurveMemberVarying | IfcStructuralCurveReaction | IfcStructuralLinearAction | IfcStructuralLinearActionVarying | IfcStructuralPlanarAction | IfcStructuralPlanarActionVarying | IfcStructuralPointAction | IfcStructuralPointConnection | IfcStructuralPointReaction | IfcStructuralSurfaceAction | IfcStructuralSurfaceConnection | IfcStructuralSurfaceMember | IfcStructuralSurfaceMemberVarying | IfcStructuralSurfaceReaction | IfcSurfaceFeature | IfcSwitchingDevice | IfcSystemFurnitureElement | IfcTank | IfcTendon | IfcTendonAnchor | IfcTendonConduit | IfcTrackElement | IfcTransformer | IfcTransportElement | IfcTubeBundle | IfcUnitaryControlElement | IfcUnitaryEquipment | IfcUnknown | IfcValve | IfcVehicle | IfcVibrationDamper | IfcVibrationIsolator | IfcVirtualElement | IfcVoidingFeature | IfcWall | IfcWallElementedCase | IfcWallStandardCase | IfcWasteTerminal | IfcWindow | IfcWindowStandardCase

      The class or type to check against.

    Returns boolean

    true if the current instance is of the specified class or type, false otherwise.

staticclearCache

  • clearCache(): void
  • Clears 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.


    Returns void

staticgetOrAdd

  • Retrieves 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.

    @throws

    Error if the provided id is not a valid class id on the format (IfcXxx).


    Parameters

    • id: string

      The id of the ModelProductClass to retrieve or add to the cache. The id is case insensitive.

    Returns ModelProductClass

    The ModelProductClass instance associated with the provided id.

staticisValidId

  • isValidId(id: string): boolean
  • Strict predicate for the canonical IFC id format (IfcXxx, or Twin).

    NOTE: this is not the rule parse / getOrAdd apply. Those deliberately accept non-Ifc* ids (DWG-entity / container classes in mixed-content twins) as 'other'-typed classes and reject only empty / whitespace / bare-Ifc ids. Use this only when you specifically need to test for a well-formed IFC class id, not to predict whether parse will accept a string.


    Parameters

    • id: string

      The string to check.

    Returns boolean

    true if the string is a well-formed IFC class id, false otherwise.

staticparse

  • Parse 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.

    @throws

    Error when id is empty, contains whitespace, or is a bare Ifc prefix with no class name. Non-Ifc* ids (e.g. Drawing, Twin, DWG-entity classes) are accepted with type 'other' so mixed-content twins parse without rejecting the whole load.


    Parameters

    • id: string

      The id of the ModelProductClass to retrieve or add to the cache. The id is case insensitive.

    Returns ModelProductClass

    The ModelProductClass instance associated with the provided id.

staticreset

  • reset(): void
  • Resets to the original state. referencedDisciplinesSet is cleared. objectCount and objectsWithGeometryCount are set to 0.


    Returns void