Skip to main content

Crate openbim_ifc_capi

Crate openbim_ifc_capi 

Source
Expand description

Versioned C ABI for the IFC facade (ADR 0013, #38).

Every export is prefixed openbim_ifc_v0_1_ and follows the conventions of Axiolid’s C ABI (its ADR 0040), so a native host can use both the same way:

  • Models are opaque non-zero u64 handles, never Rust addresses. A stale or twice-destroyed handle is OpenbimIfcStatus::InvalidHandle.
  • The caller owns every output buffer. Each such call writes the size it needs to out_required first; a null buffer with capacity 0 is the size query, and a short buffer is OpenbimIfcStatus::BufferTooSmall. No Rust allocation crosses the boundary, so there is no free function.
  • Every export runs inside catch_unwind; a panic becomes OpenbimIfcStatus::Panic and never unwinds into C.
  • C integers are validated as integers, never read as Rust enums.

Attribute values cross as a value tape: a flat pre-order array of OpenbimIfcValueNode plus one byte buffer holding every string. See tape for the encoding, which carries the same kinds as the other bindings so $/*, .U./.F. and typed wrappers stay distinct.

Reading and writing caller-provided C buffers cannot be done without unsafe, so this crate’s unsafe surface is its whole export set. It is not the only unsafe code in the workspace: the opt-in memory-mapped read (ifc_step::StepReader::read_path_mapped, wrapped by openbim-ifc-binding-core and openbim-ifc-py) is an unsafe fn too, because another process may change a mapped file. Here, each dereference sits in buffer or directly beside its null/length check, with a SAFETY comment.

The conventions above mirror Axiolid’s ADR 0040 on purpose. A divergence needs its reason recorded in the module docs or an ADR. ABI 0.1 symbols are frozen once released: a change adds openbim_ifc_v0_2_ exports rather than altering a v0_1_ one.

Re-exports§

pub use tape::OpenbimIfcValueNode;

Modules§

tape
The value tape: attribute values as flat C data.

Structs§

OpenbimIfcExpressValidationSummary
Counts from one validation run with EXPRESS rules (#538).
OpenbimIfcHistoryState
How much history a model holds (HistoryState).
OpenbimIfcValidationSummary
Counts from one validation run.
OpenbimIfcVersion
ABI and crate versions, reported separately: the ABI version changes only when the C surface does, the crate version on every release.

Enums§

OpenbimIfcStatus
Result of every ABI call. Ok is zero; every failure is non-zero.

Constants§

OPENBIM_IFC_APPEND_DRY_RUN
openbim_ifc_v0_1_model_append flag: report only.
OPENBIM_IFC_APPEND_NO_REUSE_CONTEXTS
openbim_ifc_v0_1_model_append flag: copy contexts equal to the target’s.
OPENBIM_IFC_APPEND_NO_REUSE_MATERIALS
openbim_ifc_v0_1_model_append flag: copy materials equal to the target’s.
OPENBIM_IFC_APPEND_NO_REUSE_OWNER_HISTORY
openbim_ifc_v0_1_model_append flag: copy an owner history equal to the target’s.
OPENBIM_IFC_APPEND_NO_REUSE_STYLES
openbim_ifc_v0_1_model_append flag: copy styles equal to the target’s.
OPENBIM_IFC_APPEND_NO_REUSE_UNITS
openbim_ifc_v0_1_model_append flag: copy units equal to the target’s.
OPENBIM_IFC_COPY_DRY_RUN
openbim_ifc_v0_1_model_copy_product flag: report only.
OPENBIM_IFC_COPY_NO_AGGREGATE
openbim_ifc_v0_1_model_copy_product flag: do not make the copy a part of the original’s whole.
OPENBIM_IFC_COPY_NO_CONTAINER
openbim_ifc_v0_1_model_copy_product flag: do not contain the copy in the original’s container.
OPENBIM_IFC_COPY_NO_FILLINGS
openbim_ifc_v0_1_model_copy_product flag: do not copy the fillings of the copied openings.
OPENBIM_IFC_COPY_NO_OPENINGS
openbim_ifc_v0_1_model_copy_product flag: do not copy the openings.
OPENBIM_IFC_GEOMETRY_CBOR
encoding for openbim_ifc_v0_1_model_product_geometry: CBOR bytes (RFC 8949).
OPENBIM_IFC_GEOMETRY_JSON
encoding for openbim_ifc_v0_1_model_product_geometry: JSON text (RFC 8259), UTF-8, not NUL-terminated.
OPENBIM_IFC_GLOBAL_IDS_KEEP
openbim_ifc_v0_1_model_append GlobalId mode: keep, refusing one the target holds.
OPENBIM_IFC_GLOBAL_IDS_MERGE
openbim_ifc_v0_1_model_append GlobalId mode: an IfcRoot the target holds by GlobalId and type is reused, its relationships joined.
OPENBIM_IFC_GLOBAL_IDS_REGENERATE
openbim_ifc_v0_1_model_append GlobalId mode: regenerate every one.
OPENBIM_IFC_GLOBAL_IDS_REGENERATE_COLLIDING
openbim_ifc_v0_1_model_append GlobalId mode: regenerate the ones the target holds.
OPENBIM_IFC_HANDLE_BASE
The first id of the handle range (2^62): OPENBIM_IFC_HANDLE_BASE + i names the entity operation i of a batch produced.
OPENBIM_IFC_LENGTH_FORMAT_DECIMAL
openbim_ifc_v0_1_format_length style: decimal, in display_unit (default the value’s unit) with places digits after the point.
OPENBIM_IFC_LENGTH_FORMAT_FEET_INCHES
openbim_ifc_v0_1_format_length style: feet and inches, 5' - 6 1/2", rounded to 1/places of an inch.
OPENBIM_IFC_LENGTH_FORMAT_INCHES
openbim_ifc_v0_1_format_length style: inches, 66 1/2", rounded to 1/places of an inch.
OPENBIM_IFC_LENGTH_FORMAT_SUPPRESS_ZERO_INCHES
openbim_ifc_v0_1_format_length flag: write a whole number of feet as 5' rather than 5' - 0".
OPENBIM_IFC_LENGTH_UNIT_DRY_RUN
openbim_ifc_v0_1_model_convert_length_unit flag: report only.
OPENBIM_IFC_LENGTH_UNIT_KEEP_AREA_AND_VOLUME
openbim_ifc_v0_1_model_convert_length_unit flag: keep the area and volume units and their values instead of replacing them by the square and cube of the new length unit.
OPENBIM_IFC_LENGTH_UNIT_KEEP_REPLACED_UNITS
openbim_ifc_v0_1_model_convert_length_unit flag: keep the replaced unit entities even when nothing else refers to them.
OPENBIM_IFC_PARSE_ACCEPT_REAL_WITHOUT_POINT
Read a real written without its decimal point (1E-05) as that real, with a diagnostic.
OPENBIM_IFC_PARSE_CHECK_REFERENCES
Report duplicate instance ids and references to undefined ids as diagnostics. Nothing is dropped.
OPENBIM_IFC_PARSE_LENIENT
The lenient preset: SKIP_MALFORMED | ACCEPT_REAL_WITHOUT_POINT.
OPENBIM_IFC_PARSE_SKIP_MALFORMED
Skip a data record that cannot be parsed and report it as a diagnostic, instead of failing the read.
OPENBIM_IFC_PURGE_DRY_RUN
openbim_ifc_v0_1_model_purge flag: report only.
OPENBIM_IFC_PURGE_INCLUDE_OWNER_HISTORY
openbim_ifc_v0_1_model_purge flag: also purge an unreferenced owner history with its actors.
OPENBIM_IFC_PURGE_INCLUDE_ROOTS
openbim_ifc_v0_1_model_purge flag: also purge unreferenced IfcRoots of the classes.
OPENBIM_IFC_REMOVE_DRY_RUN
openbim_ifc_v0_1_model_remove_product flag: report only.
OPENBIM_IFC_REMOVE_REBASE_PLACEMENTS
openbim_ifc_v0_1_model_remove_product flag: re-base placements relative to a removed placement instead of refusing.
OPENBIM_IFC_REMOVE_UNTYPE_OCCURRENCES
openbim_ifc_v0_1_model_remove_product flag: untype a type object’s occurrences instead of refusing.
OPENBIM_IFC_SELECTOR_GRAMMAR_MAJOR
The selector grammar’s major version (#464); a selector written for one major version parses the same in every build of it.
OPENBIM_IFC_SELECTOR_GRAMMAR_MINOR
The selector grammar’s minor version: it grows when the grammar accepts more.
OPENBIM_IFC_TABLE_CSV
Table format: RFC 4180 CSV, UTF-8.
OPENBIM_IFC_TABLE_DRY_RUN
openbim_ifc_v0_1_model_import_table flag: plan and report only.
OPENBIM_IFC_TABLE_KEY_AUTO
Key column: GlobalId for an export; for an import GlobalId when the table has one, else id.
OPENBIM_IFC_TABLE_KEY_GLOBAL_ID
Key column: GlobalId.
OPENBIM_IFC_TABLE_KEY_ID
Key column: id, the entity’s #id.
OPENBIM_IFC_TABLE_TSV
Table format: tab-separated values with \t, \n, \r, \\ escapes.
OPENBIM_IFC_TABLE_XLSX
Table format: an XLSX workbook, every cell text.

Functions§

openbim_ifc_v0_1_convert_unit⚠
Convert value from the unit named from (from_len UTF-8 bytes) to the unit named to, written to out_value. Needs no model. InvalidValue for text that names no unit; TypeMismatch for units of different dimensions; Unsupported for a unit with an offset (degree Fahrenheit, #110); InvalidArgument for text that is not UTF-8.
openbim_ifc_v0_1_curves_destroy
Destroy a polyline set. A stale or repeated handle is InvalidHandle.
openbim_ifc_v0_1_curves_positions⚠
Copy the positions of product index – x, y, z per vertex, metres, relative to its record’s transform, every polyline’s vertices in turn – into buffer (capacity floats), after writing the count needed (3 x vertex count) to out_required. OutOfRange for an index past the set.
openbim_ifc_v0_1_curves_records⚠
The set’s ProductCurves records as a tape, in the order compiled; out_count gets their number. ProductCurves: id (REF), global id, type name, transform (LIST of 16 REALs, column-major, metres, or NULL), vertex count (INTEGER), polylines (LIST of ProductPolyline), refusal (GeometryRefusal or NULL), skipped (LIST of REFs: the representation’s text literals and annotation fill areas, not drawn and not a refusal, #512). ProductPolyline: curve (REF of the IFC curve, or NULL), first vertex and vertex count (INTEGERs: its slice of the positions), closed (BOOL: its last vertex repeats its first), chord bound and chord requested (REALs, metres: the certified bound on how far the exact curve lies from the polyline, 0 for a polyline the file authored, and the budget). No polylines and no refusal is a product without the representation, or with no curves.
openbim_ifc_v0_1_entity_add⚠
Append an entity of type_name whose attribute_count attributes are on the tape back to back, and write its new id to out_id.
openbim_ifc_v0_1_entity_attribute⚠
Attribute index of entity id as a value tape ($ past the end).
openbim_ifc_v0_1_entity_attribute_by_name⚠
Attribute name (UTF-8, name_len bytes, any case, e.g. Name) of entity id as a value tape; NULL when the record stops before its slot.
openbim_ifc_v0_1_entity_attribute_names⚠
Every explicit attribute of entity id in slot order, inherited first: a LIST of AttributeInfo records, their number in out_count. AttributeInfo: name (TEXT, the schema’s spelling), index (INTEGER, the slot), type name (TEXT), optional (BOOL), aggregate (BOOL), derived (BOOL: written *, not writable), declared by (TEXT, the entity introducing it). INVERSE attributes hold no slot and are listed by openbim_ifc_v0_1_entity_inverse_attribute_names.
openbim_ifc_v0_1_entity_attributes⚠
Every attribute of entity id, back to back on one tape, plus how many top-level values it holds.
openbim_ifc_v0_1_entity_fillings⚠
Every element filling opening id (IfcRelFillsElement), in file order. Refusals as for openbim_ifc_v0_1_entity_type_object (WrongEntityType: not an IfcOpeningElement).
openbim_ifc_v0_1_entity_get_value⚠
The value path (UTF-8, e.g. type.Name, Pset_WallCommon.FireRating) reads from entity id, as a value tape: a scalar or reference as its node, several values as a LIST, a property set as a LIST of two-item LISTs, each the member’s name (TEXT) and value.
openbim_ifc_v0_1_entity_inverse_attribute_names⚠
Every INVERSE attribute of entity id, inherited ones first: a LIST of InverseAttributeInfo records, their number in out_count. InverseAttributeInfo: name (TEXT, the schema’s spelling), entity (TEXT, the referencing type before FOR), for attribute (TEXT, its attribute after FOR), aggregate (BOOL: a SET or BAG, read as a LIST), lower (INTEGER), upper (INTEGER, or NULL for ?), declared by (TEXT, the entity introducing it).
openbim_ifc_v0_1_entity_inverse_references⚠
Every reference to entity id, in ascending order: a LIST of InverseReference records, their number in out_count, one per referencing entity and attribute. InverseReference: id (REF, the referencing entity), index (INTEGER, its attribute holding the reference, directly or inside an aggregate). Needs no schema.
openbim_ifc_v0_1_entity_occurrences⚠
Every object type object id types, in file order. Refusals as for openbim_ifc_v0_1_entity_type_object (WrongEntityType: not an IfcTypeObject).
openbim_ifc_v0_1_entity_openings⚠
Every opening voiding element id (IfcRelVoidsElement), in file order. Refusals as for openbim_ifc_v0_1_entity_type_object (WrongEntityType: not an IfcElement).
openbim_ifc_v0_1_entity_remove
Remove entity id; references to it are left dangling.
openbim_ifc_v0_1_entity_remove_with_relationships
Remove entity id with its relationships: it is taken out of every relationship holding it, and a relationship left without an end goes too. Unlike openbim_ifc_v0_1_entity_remove, nothing is left dangling: StillReferenced while an entity other than a relationship needs id, MissingEntity when there is none.
openbim_ifc_v0_1_entity_set_attribute⚠
Set attribute index of entity id from a one-value tape. Writing past the end pads the gap with $.
openbim_ifc_v0_1_entity_set_attribute_by_name⚠
Set attribute name (UTF-8, any case) of entity id from a one-value tape. Every check runs before the write, so a refusal changes nothing.
openbim_ifc_v0_1_entity_set_attribute_by_name_plain⚠
Set attribute name (UTF-8, any case) of entity id from a one-value tape of plain values, coerced against the attribute’s declared type in the declared release (#342); returns as openbim_ifc_v0_1_entity_set_attribute_by_name does.
openbim_ifc_v0_1_entity_set_value⚠
Write a one-value tape of plain values at path (UTF-8) of entity id, as one transaction: an attribute (Name, type.Name) coerced as openbim_ifc_v0_1_entity_set_attribute_by_name_plain coerces it, or a property (Pset_WallCommon.FireRating) from a TYPED value, or a plain one when the property already states its type. A refusal changes nothing.
openbim_ifc_v0_1_entity_total_inverses⚠
How many distinct entities reference entity id, through any attribute, written to out_count. Needs no schema. MissingEntity.
openbim_ifc_v0_1_entity_type⚠
The type name of entity id, upper-case, NUL-terminated.
openbim_ifc_v0_1_entity_type_object⚠
The type object of occurrence id (IfcRelDefinesByType), written to out_id; NoValue when it has none. MissingEntity, WrongEntityType (not an IfcObject), InvalidModel (two types, or a malformed relationship), MissingReference, UnsupportedSchema.
openbim_ifc_v0_1_entity_voided_element⚠
The element opening id voids (IfcRelVoidsElement), written to out_id; NoValue when it voids none. Refusals as for openbim_ifc_v0_1_entity_type_object (WrongEntityType: not an IfcFeatureElementSubtraction; InvalidModel: two hosts).
openbim_ifc_v0_1_format_length⚠
Write value, a length in the unit named unit, as NUL-terminated text. style is OPENBIM_IFC_LENGTH_FORMAT_DECIMAL (in display_unit, or the value’s unit when display_unit is null, with places decimals), OPENBIM_IFC_LENGTH_FORMAT_FEET_INCHES or OPENBIM_IFC_LENGTH_FORMAT_INCHES (rounded to 1/places of an inch); flags: OPENBIM_IFC_LENGTH_FORMAT_SUPPRESS_ZERO_INCHES. Needs no model. InvalidValue for a unit name, a zero denominator or a length too large; TypeMismatch for a unit that is not a length; OutOfRange for more than 255 decimals; InvalidArgument for an unknown style or flag, or text that is not UTF-8.
openbim_ifc_v0_1_graphs_destroy
Destroy a graph set. A stale or repeated handle is InvalidHandle.
openbim_ifc_v0_1_graphs_payload⚠
Copy the wire payload of graph index – JSON text without a trailing NUL, or CBOR bytes – into buffer (capacity bytes), after writing the size needed (its record’s payload size) to out_required; 0 for a product with no graph. OutOfRange for an index past the set.
openbim_ifc_v0_1_graphs_records⚠
The set’s ProductGeometry records as a tape, in the order lowered; out_count gets their number. ProductGeometry: id (REF), global id, type name, transform (LIST of 16 REALs, column-major, metres, already applied to the graph, or NULL), encoding (json or cbor), payload size (INTEGER, bytes), refusal (GeometryRefusal or NULL). A payload size of 0 and no refusal is a product with no Body representation.
openbim_ifc_v0_1_last_error_code⚠
The last error on model as its stable code (parse, missing-entity, …), NUL-terminated; NoValue if the last call succeeded.
openbim_ifc_v0_1_last_error_message⚠
The last error on model as a human message, NUL-terminated; NoValue if the last call succeeded.
openbim_ifc_v0_1_last_error_span⚠
The byte range in the query the last error on model refuses, written to out_start and out_end; NoValue when the last call succeeded or its error names no span (only InvalidSelector does).
openbim_ifc_v0_1_live_models⚠
Number of live models, for leak checks.
openbim_ifc_v0_1_meshes_destroy
Destroy a mesh set. A stale or repeated handle is InvalidHandle.
openbim_ifc_v0_1_meshes_indices⚠
Copy the triangle indices of mesh index – three vertex indices per triangle – into buffer (capacity values), after writing the count needed (3 x triangle count) to out_required. OutOfRange for an index past the set.
openbim_ifc_v0_1_meshes_positions⚠
Copy the positions of mesh index – x, y, z per vertex, metres, relative to its record’s transform – into buffer (capacity floats), after writing the count needed (3 x vertex count) to out_required. OutOfRange for an index past the set.
openbim_ifc_v0_1_meshes_records⚠
The set’s ProductMesh records as a tape, in the order compiled; out_count gets their number. ProductMesh: id (REF), global id, type name, transform (LIST of 16 REALs, column-major, metres, or NULL), vertex count, triangle count (INTEGERs), refusal (GeometryRefusal or NULL), colour (SurfaceColour or NULL), colour refusal (GeometryRefusal or NULL), closure (TEXT, #458: solid, surface for an area with no volume, or unknown for an empty or refused mesh). Empty arrays and no refusal is a product with no Body representation.
openbim_ifc_v0_1_model_append⚠
Copy the id_count entities ids of model source into model target with what belongs to them, as one checked transaction: what they reference, their property sets, type, material and classification, their openings, fillings and ports, and what attaches to their geometry. Units, contexts, the owner history, materials and styles equal to the target’s are reused unless a flag says otherwise. Relationships to objects not copied (a spatial container) are skipped and reported. global_ids: OPENBIM_IFC_GLOBAL_IDS_KEEP, _REGENERATE, _REGENERATE_COLLIDING or _MERGE. flags: OPENBIM_IFC_APPEND_NO_REUSE_UNITS, _CONTEXTS, _OWNER_HISTORY, _MATERIALS, _STYLES, OPENBIM_IFC_APPEND_DRY_RUN. The answer is a CopyReport tape (see the module docs); a size query or a short buffer plans the append and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_author⚠
Apply the operations on the tape as one checked transaction against the release the header declares: all of them, in order, or none, and the model unchanged.
openbim_ifc_v0_1_model_by_guid⚠
The entity whose GlobalId is global_id (UTF-8, global_len bytes), written to out_id; NoValue when none carries it.
openbim_ifc_v0_1_model_classifications⚠
The classifications of object: a LIST of Classification records, its own then its type object’s; out_count gets their number. Classification: relationship (REF), global id, source, type object, target (REF), kind (reference, system or notation), identification, name, location, notation (LIST of TEXT), parents (LIST of REF), system ([id, name, source, edition] or NULL).
openbim_ifc_v0_1_model_clear_history
Drop every undo and redo entry, keeping the limit.
openbim_ifc_v0_1_model_convert_length_unit⚠
Convert the model’s length unit to the unit named target (target_len UTF-8 bytes): an SI METRE with any prefix, or inch, foot, yard, mile, US survey foot. Every length, area and volume value is rescaled as one checked transaction. flags: OPENBIM_IFC_LENGTH_UNIT_KEEP_AREA_AND_VOLUME, OPENBIM_IFC_LENGTH_UNIT_KEEP_REPLACED_UNITS, OPENBIM_IFC_LENGTH_UNIT_DRY_RUN. The answer is the LengthUnitReport tape of the module docs; a size query or a short buffer plans the conversion and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_convert_unit_value⚠
Convert value from unit entity from to unit entity to of the model (an IfcSIUnit, IfcConversionBasedUnit or IfcDerivedUnit), written to out_value. MissingEntity; TypeMismatch for units of different dimensions; Unsupported for a monetary, context-dependent or offset unit; InvalidModel for a unit that does not resolve; UnsupportedSchema; FeatureDisabled.
openbim_ifc_v0_1_model_copy_product⚠
Copy product (or type object) product with everything it solely owns, as one checked transaction: its placement, representation, own property and quantity sets, material usage, ports and, unless a flag says otherwise, its openings and the doors and windows filling them; joining its type, shared property sets, classification and, unless a flag says otherwise, its container and whole. placement non-zero places the copy by that IfcObjectPlacement; offset non-null (three doubles) moves it in its parent placement’s frame; not both. flags: OPENBIM_IFC_COPY_NO_OPENINGS, OPENBIM_IFC_COPY_NO_FILLINGS, OPENBIM_IFC_COPY_NO_CONTAINER, OPENBIM_IFC_COPY_NO_AGGREGATE, OPENBIM_IFC_COPY_DRY_RUN. The answer is a CopyReport tape (see the module docs); a size query or a short buffer plans the copy and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_cost⚠
Every cost schedule and cost item as one Cost record: schedules (LIST of CostSchedule), items (LIST of CostItem, each with its CostValue tree, applied values tagged), anomalies.
openbim_ifc_v0_1_model_create⚠
Create an empty model and write its handle to out_model.
openbim_ifc_v0_1_model_create_entity⚠
Create one entity of type_name (UTF-8, any case) from named attributes: a batch of one CREATE. The tape is one LIST of LIST(TEXT name, value) pairs (an empty LIST for none). An IfcRoot without a GlobalId gets a fresh one. out_id gets the new id.
openbim_ifc_v0_1_model_dangling_references⚠
Every dangling reference as (from, to) pairs, flattened: element 2k is a referencing id, 2k+1 the missing id it points to.
openbim_ifc_v0_1_model_destroy
Destroy a model. A stale or repeated handle is InvalidHandle.
openbim_ifc_v0_1_model_diagnostic⚠
Diagnostic index as a NUL-terminated string; OutOfRange past the end.
openbim_ifc_v0_1_model_diagnostic_count⚠
Number of non-fatal parse diagnostics.
openbim_ifc_v0_1_model_duplicate_global_ids⚠
Every GlobalId several entities carry, in GlobalId order, and how many. The tape is a LIST; each item a LIST of the GlobalId (TEXT) and its holders in file order (LIST of REF). Empty for a conformant file. UnsupportedSchema.
openbim_ifc_v0_1_model_export_table⚠
The entities selector query (UTF-8) selects as a table in format (OPENBIM_IFC_TABLE_CSV, _TSV, _XLSX), filling buffer as openbim_ifc_v0_1_model_write does: the key column first (key: OPENBIM_IFC_TABLE_KEY_AUTO or _GLOBAL_ID for GlobalId, _ID for id), then one column per value path of columns (column_count UTF-8 paths of column_lengths[i] bytes, e.g. type.Name, Pset_WallCommon.FireRating), each cell the value the path reads as text, NULL as null (UTF-8, may be empty).
openbim_ifc_v0_1_model_georeferencing⚠
Every coordinate operation, resolved: a LIST of MapConversion records, empty when the model has none; out_count gets their number. MapConversion: operation, kind, source, source kind, target CRS (ProjectedCrs record), eastings, northings, orthogonal height, x axis (two REALs), scale, factors (three REALs or NULL), project unit and map unit ([name, metres per unit]), map unit declared (BOOL), linear (three columns of three REALs), translation (three REALs).
openbim_ifc_v0_1_model_header⚠
The file header as a value tape: one LIST of ten values, in STEP header order – description (LIST of TEXT), implementation level, name, time stamp, author (LIST), organization (LIST), preprocessor version, originating system, authorization, schema (LIST).
openbim_ifc_v0_1_model_history⚠
Write the history bound and how many entries each direction holds.
openbim_ifc_v0_1_model_ids⚠
Every entity id, in file order.
openbim_ifc_v0_1_model_ids_of_type⚠
Ids of every entity of exactly type_name (UTF-8, type_len bytes, case-insensitive). Subtypes are not included.
openbim_ifc_v0_1_model_ids_of_type_including_subtypes⚠
Ids of every entity of type_name or any of its subtypes, using the schema the file’s header declares. UnsupportedSchema if none is bundled.
openbim_ifc_v0_1_model_import_table⚠
Apply the table data (data_len bytes in format) to the model by its key column (key, as for openbim_ifc_v0_1_model_export_table) as one checked transaction, null (UTF-8) being the cell text of NULL. flags: OPENBIM_IFC_TABLE_DRY_RUN. The answer is a TableImport tape: applied (BOOL), changes (LIST of TableChange: row, column INTEGER, key, path TEXT, entity, target entity REF, target, before, after TEXT), refusals (LIST of TableRefusal: row, column INTEGER or NULL, code, message TEXT, span LIST of two INTEGERs or NULL). Any refusal means nothing was written; a size query or a short buffer plans the import and writes nothing.
openbim_ifc_v0_1_model_len⚠
Number of entities.
openbim_ifc_v0_1_model_material⚠
The material association of object, its own or its type object’s, as one MaterialAssignment record, or a NULL tape when there is none: relationship, global id, source, type object, target, type name, kind, set, name, materials, layers, profiles, constituents (each a LIST of records), usage (record or NULL).
openbim_ifc_v0_1_model_open⚠
Read the STEP file at path (UTF-8, path_len bytes, no NUL needed) into a model that owns its bytes, and write the new model’s handle. An ifcZIP archive is read as openbim_ifc_v0_1_model_parse reads one.
openbim_ifc_v0_1_model_open_mapped⚠
Read the STEP file at path through a memory mapping, and write the new model’s handle. No copy of the file is made, and its pages belong to the page cache rather than the process heap.
openbim_ifc_v0_1_model_open_mapped_with_options⚠
As openbim_ifc_v0_1_model_open_mapped, under the OPENBIM_IFC_PARSE_* flags.
openbim_ifc_v0_1_model_open_with_options⚠
As openbim_ifc_v0_1_model_open, under the OPENBIM_IFC_PARSE_* flags.
openbim_ifc_v0_1_model_parse⚠
Parse len bytes of STEP and write the new model’s handle.
openbim_ifc_v0_1_model_parse_ifcxml⚠
Parse len bytes of ifcXML and write the new model’s handle.
openbim_ifc_v0_1_model_parse_with_options⚠
As openbim_ifc_v0_1_model_parse, under the OPENBIM_IFC_PARSE_* flags (0 is the strict read). What a lenient read recovers from is listed by openbim_ifc_v0_1_model_diagnostic.
openbim_ifc_v0_1_model_product_curves⚠
Compile the curves of each product’s representation as polylines (#458), for ids (id_count of them) or, with ids null and id_count 0, every product with a shape, and write the new set’s handle to out_curves. representation is representation_len bytes of UTF-8: Plan (the best drawing curves: Plan, Annotation, FootPrint, then Axis, preferring a PLAN_VIEW context), Axis, FootPrint, Annotation, Body, Surface or Reference. Read the set with openbim_ifc_v0_1_curves_records and _curves_positions; destroy it with openbim_ifc_v0_1_curves_destroy. The chord budget is one millimetre.
openbim_ifc_v0_1_model_product_geometry⚠
Lower the Body of each of ids (id_count of them) or, with ids null and id_count 0, of every product with a shape, encode each graph in Axiolid’s wire format as encoding (OPENBIM_IFC_GEOMETRY_JSON or _CBOR), and write the new set’s handle to out_graphs. Read it with openbim_ifc_v0_1_graphs_records and _graphs_payload; destroy it with openbim_ifc_v0_1_graphs_destroy.
openbim_ifc_v0_1_model_product_meshes⚠
Compile the Body mesh of each of ids (id_count of them) or, with ids null and id_count 0, of every product with a shape, and write the new set’s handle to out_meshes. Read it with openbim_ifc_v0_1_meshes_records, _meshes_positions and _meshes_indices; destroy it with openbim_ifc_v0_1_meshes_destroy.
openbim_ifc_v0_1_model_product_meshes_for⚠
As openbim_ifc_v0_1_model_product_meshes, meshing each product’s representation (#458): representation_len bytes of UTF-8 at representation, one of Body (as the call above), Plan, Axis, FootPrint, Annotation, Surface or Reference. Its surfaces and solids are one mesh, whose record’s closure says solid or surface; its curves are left to openbim_ifc_v0_1_model_product_curves. A product without the representation, or with curves only, has an empty mesh and no refusal. Only a Body mesh carries a colour.
openbim_ifc_v0_1_model_product_placements⚠
Each product’s world placement and selected Body representation, for ids (id_count of them) or, with ids null and id_count 0, every product with a shape, in id order. The tape is a LIST of ProductPlacement records; out_count gets their number. ProductPlacement: id (REF), global id, type name, transform (LIST of 16 REALs, a column-major 4x4 in metres, or NULL), representation (SelectedRepresentation or NULL), refusal (GeometryRefusal or NULL). SelectedRepresentation: id, identifier, representation type, context (REF or NULL), context type, context identifier, target view. GeometryRefusal: code (unsupported, invalid-model, missing-reference or budget-exceeded), entity (REF or NULL), message.
openbim_ifc_v0_1_model_property_sets⚠
The property sets of object: a LIST of PropertySet records, its own sets first, then those its type object holds; out_count gets their number. PropertySet: id (REF), global id, name, type name, source (occurrence or type), source id (REF or NULL), properties (LIST of Property). Property: id, name, type name, kind, value type, unit (REF or NULL), value (tagged, typed), enumeration, bounds, table, usage, discrimination, quality, members (LIST of Property).
openbim_ifc_v0_1_model_property_sets_many⚠
The property sets of each of ids (id_count of them), in that order, or, with ids null and id_count 0, of every object definition (IfcObjectDefinition and its subtypes) in file order, resolved in one pass through one property index (#358): a LIST of ObjectPropertySets records, their number in out_count. ObjectPropertySets: object (REF), sets (LIST of PropertySet, as for openbim_ifc_v0_1_model_property_sets; empty when refused), refusal (PropertyRefusal or NULL: code (TEXT, the shared binding code), message (TEXT)). Each record is exactly what the per-object call answers for that id, its refusal included.
openbim_ifc_v0_1_model_purge⚠
Purge unreferenced entities as one checked transaction. With class_count 0, every resource entity no IfcRoot reaches (nor annotates something reached); otherwise entities of the class_count classes (UTF-8 names of class_lengths[i] bytes, any case, subtypes included) that nothing references. flags: OPENBIM_IFC_PURGE_INCLUDE_ROOTS, OPENBIM_IFC_PURGE_INCLUDE_OWNER_HISTORY, OPENBIM_IFC_PURGE_DRY_RUN. The answer is a RemovalReport tape: removed (LIST of RemovedEntity: id REF, type name TEXT), kept (LIST of KeptEntity: id, type name, reason TEXT – shared, related-object, definition, protected – users LIST of REF), detached and rebased (LISTs of REF), applied (BOOL, false for a dry run). A size query or a short buffer plans the removal and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_redo⚠
Reverse the last undo. The answer and the buffer protocol are those of openbim_ifc_v0_1_model_undo; HistoryEmpty with nothing to redo.
openbim_ifc_v0_1_model_remove_product⚠
Remove product (or type object) product with everything it solely owns – its placement, representation, own property and quantity sets, material usage, openings and ports, and relationships left without an end – keeping what is shared, as one checked transaction. flags: OPENBIM_IFC_REMOVE_REBASE_PLACEMENTS, OPENBIM_IFC_REMOVE_UNTYPE_OCCURRENCES, OPENBIM_IFC_REMOVE_DRY_RUN. The answer is a RemovalReport tape: removed (LIST of RemovedEntity: id REF, type name TEXT), kept (LIST of KeptEntity: id, type name, reason TEXT – shared, related-object, definition, protected – users LIST of REF), detached and rebased (LISTs of REF), applied (BOOL, false for a dry run). A size query or a short buffer plans the removal and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_remove_property⚠
Remove one property from object’s own set: openbim_ifc_v0_1_model_set_properties with one REMOVE edit.
openbim_ifc_v0_1_model_remove_representation⚠
Remove shape representation representation with what only it uses, as one checked transaction: taken off its product definition shape (which goes when left empty), representation map or shape aspects, then removed with its items down to what nothing else uses; shared items, profiles, points and styles stay. flags: OPENBIM_IFC_REMOVE_DRY_RUN alone. The answer is the RemovalReport tape of openbim_ifc_v0_1_model_remove_product; a size query or a short buffer plans the removal and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_resolve_unit⚠
The effective unit of a measure_type value (IFCAREAMEASURE, UTF-8, measure_len bytes): unit when non-zero (a property’s stated unit), otherwise the project default. The tape is one ResolvedUnit: unit (REF or NULL), from project (BOOL), dimensions (LIST of seven INTEGERs, SI exponents L M T I Θ N J), scale (REAL), offset (REAL).
openbim_ifc_v0_1_model_schema⚠
The first FILE_SCHEMA token as a NUL-terminated string, or NoValue.
openbim_ifc_v0_1_model_select⚠
The ids selector query (UTF-8, query_len bytes) selects, ascending, filling buffer as openbim_ifc_v0_1_model_ids does.
openbim_ifc_v0_1_model_select_from⚠
As openbim_ifc_v0_1_model_select, selecting from the base_count ids at base alone; MissingEntity for one the model lacks.
openbim_ifc_v0_1_model_set_header⚠
Replace the file header with the one on the tape. A tape of any other shape is InvalidValue and leaves the header unchanged.
openbim_ifc_v0_1_model_set_history_limit
Bound the undo entries a model keeps. 0 turns history off and drops what is held; a lower limit drops the oldest entries. History is off (0) for a new model.
openbim_ifc_v0_1_model_set_properties⚠
Apply the edits on the tape as one checked transaction: all of them, in order, or none, and the model unchanged.
openbim_ifc_v0_1_model_set_property⚠
Write one value: openbim_ifc_v0_1_model_set_properties with one SET edit. set and name are UTF-8; the value is a one-value tape; set_type (IfcPropertySet or IfcElementQuantity) may be null with length 0. out_id gets the entity holding the property.
openbim_ifc_v0_1_model_spatial_tree⚠
The spatial containment tree as one SpatialTree record: release (TEXT or NULL), roots (LIST of REF), nodes (LIST of SpatialNode: id, global id, name, type name, kind, parent, children, elements, referenced), orphans, dangling (LIST of [relation, target]), anomalies (LIST of [kind, relation, subject, kept]).
openbim_ifc_v0_1_model_systems⚠
Every system as one Systems record: systems (LIST of System: id, global id, type name, name, long name, predefined type, members, serviced buildings, serviced facilities) and anomalies (LIST of [kind, subject, other, message]).
openbim_ifc_v0_1_model_undo⚠
Restore the model to the state before the last recorded change: entities under their ids and at their file positions, the header included. The answer is a HistoryChange tape: created, removed and modified (LISTs of REF) and header (BOOL). A size query or a short buffer peeks the step and answers BufferTooSmall without applying it.
openbim_ifc_v0_1_model_unreachable_products⚠
Products no viewer will draw, in id order, and how many.
openbim_ifc_v0_1_model_validate⚠
Validate against the schema the header declares.
openbim_ifc_v0_1_model_validate_express⚠
Validate with the EXPRESS rules of the declared release, read from express, the UTF-8 text of that release’s .exp file (#538).
openbim_ifc_v0_1_model_write⚠
Serialize as STEP into a caller buffer; out_required gets the size.
openbim_ifc_v0_1_model_write_ifcxml⚠
Serialize as ifcXML into a caller buffer; out_required gets the size. profile as for openbim_ifc_v0_1_model_parse_ifcxml. An XSD-layout write needs the header to declare the profile’s schema, and refuses with Write what the configuration cannot carry.
openbim_ifc_v0_1_model_write_ifczip⚠
Serialize as an ifcZIP archive into a caller buffer; out_required gets the size.
openbim_ifc_v0_1_name_based_guid⚠
The GlobalId named by parts (RFC 9562 version 8), NUL-terminated: the same parts give the same GlobalId in every binding and release. parts holds part_count UTF-8 strings of part_lengths[i] bytes each. Needs no model; InvalidArgument for a part that is not UTF-8.
openbim_ifc_v0_1_new_guid⚠
A new random GlobalId (RFC 9562 version 4, from the operating system’s generator) in IFC’s 22-character form, NUL-terminated: 23 bytes. Needs no model. Unsupported when the system has no random source.
openbim_ifc_v0_1_version⚠
Write the ABI and crate versions.

Type Aliases§

OpenbimIfcCurves
Opaque handle to a compiled polyline set. Zero is never a valid handle.
OpenbimIfcGraphs
Opaque handle to an encoded graph set. Zero is never a valid handle.
OpenbimIfcMeshes
Opaque handle to a compiled mesh set. Zero is never a valid handle.
OpenbimIfcModel
Opaque model handle. Zero is never a valid handle.