-
Notifications
You must be signed in to change notification settings - Fork 1
API Reference
Maarten Vroegindeweij edited this page Feb 18, 2026
·
1 revision
Consolidated reference of all public functions, classes, and types across all Ifc-Factory packages.
| Method | Signature | Description |
|---|---|---|
fromStep |
(source: string) => IfcModel |
Parse a STEP file string into an IfcModel |
| Method | Signature | Description |
|---|---|---|
get |
(id: number) => IfcGenericEntity | undefined |
Get entity by expressID |
create |
(typeName: string, attrs: object) => IfcGenericEntity |
Create a new entity (auto-assigns expressID) |
update |
(id: number, changes: object) => void |
Update entity attributes |
delete |
(id: number) => void |
Delete an entity |
getAllOfType |
(typeName: string) => IfcGenericEntity[] |
Get all entities of a given type |
toStep |
() => string |
Serialize model to STEP format |
getSpatialTree |
() => SpatialTreeNode |
Build and return the spatial hierarchy tree |
getAggregateChildren |
(parentId: number) => IfcGenericEntity[] |
Get children via IfcRelAggregates |
getContainedElements |
(spatialId: number) => IfcGenericEntity[] |
Get elements in spatial structure |
containInSpatialStructure |
(spatialId: number, elementId: number) => void |
Place element in spatial element |
| Property | Type | Description |
|---|---|---|
project |
IfcGenericEntity | undefined |
The first IfcProject entity |
size |
number |
Total entity count |
schema |
string |
Schema identifier (e.g., 'IFC4X3') |
| Function | Signature | Description |
|---|---|---|
createSpatialStructure |
(model, options) => { project, site, building, storeys } |
Create complete spatial hierarchy |
flattenSpatialTree |
(tree: SpatialTreeNode) => SpatialTreeNode[] |
Flatten tree to flat array |
interface SpatialStructureOptions {
projectName: string;
siteName: string;
buildingName: string;
storeyNames: string[];
}
interface SpatialTreeNode {
entity: IfcGenericEntity;
children: SpatialTreeNode[];
}| Function | Signature | Description |
|---|---|---|
createPropertySet |
(model, name: string, properties: PropertyValue[]) => IfcGenericEntity |
Create IfcPropertySet |
createQuantitySet |
(model, name: string, quantities: QuantityValue[]) => IfcGenericEntity |
Create IfcElementQuantity |
assignPropertySet |
(model, psetId: number, elementIds: number[]) => IfcGenericEntity |
Assign pset via IfcRelDefinesByProperties |
getPropertySets |
(model, elementId: number) => IfcGenericEntity[] |
Get all property sets for an element |
interface PropertyValue {
name: string;
value: string | number | boolean;
type?: string; // 'IFCREAL', 'IFCLABEL', etc.
}
interface QuantityValue {
name: string;
value: number;
quantityType: 'LENGTH' | 'AREA' | 'VOLUME' | 'WEIGHT' | 'COUNT' | 'TIME';
}| Function | Signature | Description |
|---|---|---|
createDocumentInformation |
(model, options) => IfcGenericEntity |
Create IfcDocumentInformation |
createDocumentReference |
(model, options) => IfcGenericEntity |
Create IfcDocumentReference |
associateDocument |
(model, docId: number, elementIds: number[]) => IfcGenericEntity |
Associate via IfcRelAssociatesDocument |
interface DocumentOptions {
name: string;
description?: string;
location?: string;
identification?: string;
}| Function | Signature | Description |
|---|---|---|
createLibraryInformation |
(model, options) => IfcGenericEntity |
Create IfcLibraryInformation |
createLibraryReference |
(model, options) => IfcGenericEntity |
Create IfcLibraryReference |
associateLibrary |
(model, libId: number, elementIds: number[]) => IfcGenericEntity |
Associate via IfcRelAssociatesLibrary |
interface LibraryOptions {
name: string;
version?: string;
description?: string;
}
interface LibraryReferenceOptions {
name: string;
identification?: string;
libraryId: number;
}| Function | Signature | Description |
|---|---|---|
createClassification |
(model, options) => IfcGenericEntity |
Create IfcClassification |
createClassificationReference |
(model, options) => IfcGenericEntity |
Create IfcClassificationReference |
associateClassification |
(model, refId: number, elementIds: number[]) => IfcGenericEntity |
Associate via IfcRelAssociatesClassification |
interface ClassificationOptions {
name: string;
edition?: string;
source?: string;
}
interface ClassificationReferenceOptions {
identification: string;
name?: string;
classificationId: number;
}| Function | Signature | Description |
|---|---|---|
createAnnotation |
(model, options) => IfcGenericEntity |
Create IfcAnnotation |
createTextLiteral |
(model, options) => IfcGenericEntity |
Create IfcTextLiteral |
| Function | Signature | Description |
|---|---|---|
createRelAggregates |
(model, parentId: number, childIds: number[]) => IfcGenericEntity |
Create IfcRelAggregates |
createRelAssociatesMaterial |
(model, materialId: number, elementIds: number[]) => IfcGenericEntity |
Create IfcRelAssociatesMaterial |
createRelAssociatesClassification |
(model, refId: number, elementIds: number[]) => IfcGenericEntity |
Create IfcRelAssociatesClassification |
createRelAssociatesDocument |
(model, docId: number, elementIds: number[]) => IfcGenericEntity |
Create IfcRelAssociatesDocument |
createRelAssociatesLibrary |
(model, libId: number, elementIds: number[]) => IfcGenericEntity |
Create IfcRelAssociatesLibrary |
| Function | Signature | Description |
|---|---|---|
generateIfcGuid |
() => string |
Generate 22-char IFC base64 GUID |
| Function | Signature | Description |
|---|---|---|
createBBLPropertySet |
(model, elementIds: number[], data: BBLData) => void |
Create BBL fire safety property set |
createBENGPropertySet |
(model, elementIds: number[], data: BENGData) => void |
Create BENG energy property set |
createAeriusPropertySet |
(model, elementIds: number[], data: AeriusData) => void |
Create Aerius nitrogen property set |
See Dutch Compliance for data types and details.
| Export | Type | Description |
|---|---|---|
QueryBuilder |
class | Fluent query builder |
byType |
function | Filter by entity type |
byProperty |
function | Filter by property value |
byPropertyExists |
function | Filter by property existence |
and |
function | Combine predicates (all must match) |
or |
function | Combine predicates (any must match) |
not |
function | Invert a predicate |
See Query API for full documentation.
| Export | Type | Description |
|---|---|---|
SCHEMA_METADATA |
Record<string, EntityMetadata> |
Runtime metadata for all 876 entity types |
ENTITY_REGISTRY |
Record<string, string> |
UPPERCASE → PascalCase name mapping |
IfcGenericEntity |
interface | Base entity type with expressID, type, [key: string]: unknown
|
StepEntityBase |
interface | Base STEP entity interface |
IfcWall, IfcDoor, ... |
interfaces | 876 typed entity interfaces |
IfcWallTypeEnum, ... |
enums | 243 string enumerations |
| Function | Signature | Description |
|---|---|---|
parseStepToEntities |
(source: string) => ParseResult |
Two-pass parse: STEP string → typed entities |
writeEntitiesToStep |
(entities: Map<number, IfcGenericEntity>, schema?: string) => string |
Serialize entities to STEP |
interface ParseResult {
schema: string;
entities: Map<number, IfcGenericEntity>;
header: StepHeader;
}| Function | Signature | Description |
|---|---|---|
readStepFile |
(source: string) => StepFile |
Parse raw STEP file (schema-agnostic) |
writeStepFile |
(stepFile: StepFile) => string |
Serialize StepFile to STEP string |
decodeStepString |
(encoded: string) => string |
Decode STEP unicode escapes |
encodeStepString |
(str: string) => string |
Encode string for STEP |
| Function | Signature | Description |
|---|---|---|
parseExpress |
(source: string) => SchemaNode |
Parse EXPRESS schema to AST |
tokenize |
(source: string) => Token[] |
Tokenize EXPRESS source |
| Function | Signature | Description |
|---|---|---|
validateModel |
(model: IfcModel) => ValidationIssue[] |
Validate model |
diffModels |
(a: IfcModel, b: IfcModel) => ModelDiff |
Compare models |
detectSchemaVersion |
(source: string) => IfcSchemaVersion |
Detect schema |
isIfc4x3 |
(source: string) => boolean |
Check if IFC4X3 |
generateIfcGuid |
() => string |
Generate GUID |
generateMultipleGuids |
(count: number) => string[] |
Generate multiple GUIDs |
validateGuid |
(guid: string) => string[] |
Validate GUID format |
isValidIfcGuid |
(guid: string) => boolean |
Quick GUID check |
batchAssignProperties |
(model, assignments[]) => void |
Batch property assignment |
batchUpdateProperty |
(model, ids[], prop, value) => number |
Batch update |
Ifc-Factory
Getting Started
Concepts
Packages
API & Reference
Development