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
u64handles, never Rust addresses. A stale or twice-destroyed handle isOpenbimIfcStatus::InvalidHandle. - The caller owns every output buffer. Each such call writes the size it
needs to
out_requiredfirst; a null buffer with capacity 0 is the size query, and a short buffer isOpenbimIfcStatus::BufferTooSmall. No Rust allocation crosses the boundary, so there is no free function. - Every export runs inside
catch_unwind; a panic becomesOpenbimIfcStatus::Panicand 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§
- Openbim
IfcExpress Validation Summary - Counts from one validation run with EXPRESS rules (#538).
- Openbim
IfcHistory State - How much history a model holds (
HistoryState). - Openbim
IfcValidation Summary - Counts from one validation run.
- Openbim
IfcVersion - ABI and crate versions, reported separately: the ABI version changes only when the C surface does, the crate version on every release.
Enums§
- Openbim
IfcStatus - Result of every ABI call.
Okis zero; every failure is non-zero.
Constants§
- OPENBIM_
IFC_ APPEND_ DRY_ RUN openbim_ifc_v0_1_model_appendflag: report only.- OPENBIM_
IFC_ APPEND_ NO_ REUSE_ CONTEXTS openbim_ifc_v0_1_model_appendflag: copy contexts equal to the target’s.- OPENBIM_
IFC_ APPEND_ NO_ REUSE_ MATERIALS openbim_ifc_v0_1_model_appendflag: copy materials equal to the target’s.- OPENBIM_
IFC_ APPEND_ NO_ REUSE_ OWNER_ HISTORY openbim_ifc_v0_1_model_appendflag: copy an owner history equal to the target’s.- OPENBIM_
IFC_ APPEND_ NO_ REUSE_ STYLES openbim_ifc_v0_1_model_appendflag: copy styles equal to the target’s.- OPENBIM_
IFC_ APPEND_ NO_ REUSE_ UNITS openbim_ifc_v0_1_model_appendflag: copy units equal to the target’s.- OPENBIM_
IFC_ COPY_ DRY_ RUN openbim_ifc_v0_1_model_copy_productflag: report only.- OPENBIM_
IFC_ COPY_ NO_ AGGREGATE openbim_ifc_v0_1_model_copy_productflag: do not make the copy a part of the original’s whole.- OPENBIM_
IFC_ COPY_ NO_ CONTAINER openbim_ifc_v0_1_model_copy_productflag: do not contain the copy in the original’s container.- OPENBIM_
IFC_ COPY_ NO_ FILLINGS openbim_ifc_v0_1_model_copy_productflag: do not copy the fillings of the copied openings.- OPENBIM_
IFC_ COPY_ NO_ OPENINGS openbim_ifc_v0_1_model_copy_productflag: do not copy the openings.- OPENBIM_
IFC_ GEOMETRY_ CBOR encodingforopenbim_ifc_v0_1_model_product_geometry: CBOR bytes (RFC 8949).- OPENBIM_
IFC_ GEOMETRY_ JSON encodingforopenbim_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_appendGlobalIdmode: keep, refusing one the target holds.- OPENBIM_
IFC_ GLOBAL_ IDS_ MERGE openbim_ifc_v0_1_model_appendGlobalIdmode: anIfcRootthe target holds byGlobalIdand type is reused, its relationships joined.- OPENBIM_
IFC_ GLOBAL_ IDS_ REGENERATE openbim_ifc_v0_1_model_appendGlobalIdmode: regenerate every one.- OPENBIM_
IFC_ GLOBAL_ IDS_ REGENERATE_ COLLIDING openbim_ifc_v0_1_model_appendGlobalIdmode: regenerate the ones the target holds.- OPENBIM_
IFC_ HANDLE_ BASE - The first id of the handle range (2^62):
OPENBIM_IFC_HANDLE_BASE + inames the entity operationiof a batch produced. - OPENBIM_
IFC_ LENGTH_ FORMAT_ DECIMAL openbim_ifc_v0_1_format_lengthstyle: decimal, indisplay_unit(default the value’s unit) withplacesdigits after the point.- OPENBIM_
IFC_ LENGTH_ FORMAT_ FEET_ INCHES openbim_ifc_v0_1_format_lengthstyle: feet and inches,5' - 6 1/2", rounded to1/placesof an inch.- OPENBIM_
IFC_ LENGTH_ FORMAT_ INCHES openbim_ifc_v0_1_format_lengthstyle: inches,66 1/2", rounded to1/placesof an inch.- OPENBIM_
IFC_ LENGTH_ FORMAT_ SUPPRESS_ ZERO_ INCHES openbim_ifc_v0_1_format_lengthflag: write a whole number of feet as5'rather than5' - 0".- OPENBIM_
IFC_ LENGTH_ UNIT_ DRY_ RUN openbim_ifc_v0_1_model_convert_length_unitflag: report only.- OPENBIM_
IFC_ LENGTH_ UNIT_ KEEP_ AREA_ AND_ VOLUME openbim_ifc_v0_1_model_convert_length_unitflag: 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_unitflag: 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_purgeflag: report only.- OPENBIM_
IFC_ PURGE_ INCLUDE_ OWNER_ HISTORY openbim_ifc_v0_1_model_purgeflag: also purge an unreferenced owner history with its actors.- OPENBIM_
IFC_ PURGE_ INCLUDE_ ROOTS openbim_ifc_v0_1_model_purgeflag: also purge unreferencedIfcRoots of the classes.- OPENBIM_
IFC_ REMOVE_ DRY_ RUN openbim_ifc_v0_1_model_remove_productflag: report only.- OPENBIM_
IFC_ REMOVE_ REBASE_ PLACEMENTS openbim_ifc_v0_1_model_remove_productflag: re-base placements relative to a removed placement instead of refusing.- OPENBIM_
IFC_ REMOVE_ UNTYPE_ OCCURRENCES openbim_ifc_v0_1_model_remove_productflag: 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_tableflag: plan and report only.- OPENBIM_
IFC_ TABLE_ KEY_ AUTO - Key column:
GlobalIdfor an export; for an importGlobalIdwhen the table has one, elseid. - 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
valuefrom the unit namedfrom(from_lenUTF-8 bytes) to the unit namedto, written toout_value. Needs no model.InvalidValuefor text that names no unit;TypeMismatchfor units of different dimensions;Unsupportedfor a unit with an offset (degree Fahrenheit, #110);InvalidArgumentfor 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, zper vertex, metres, relative to its record’s transform, every polyline’s vertices in turn – intobuffer(capacityfloats), after writing the count needed (3 x vertex count) toout_required.OutOfRangefor an index past the set. - openbim_
ifc_ ⚠v0_ 1_ curves_ records - The set’s
ProductCurvesrecords as a tape, in the order compiled;out_countgets their number.ProductCurves: id (REF), global id, type name, transform (LISTof 16REALs, column-major, metres, orNULL), vertex count (INTEGER), polylines (LISTofProductPolyline), refusal (GeometryRefusalorNULL), skipped (LISTofREFs: the representation’s text literals and annotation fill areas, not drawn and not a refusal, #512).ProductPolyline: curve (REFof the IFC curve, orNULL), 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,0for 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_namewhoseattribute_countattributes are on the tape back to back, and write its new id toout_id. - openbim_
ifc_ ⚠v0_ 1_ entity_ attribute - Attribute
indexof entityidas a value tape ($past the end). - openbim_
ifc_ ⚠v0_ 1_ entity_ attribute_ by_ name - Attribute
name(UTF-8,name_lenbytes, any case, e.g.Name) of entityidas a value tape;NULLwhen the record stops before its slot. - openbim_
ifc_ ⚠v0_ 1_ entity_ attribute_ names - Every explicit attribute of entity
idin slot order, inherited first: aLISTofAttributeInforecords, their number inout_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).INVERSEattributes hold no slot and are listed byopenbim_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 foropenbim_ifc_v0_1_entity_type_object(WrongEntityType: not anIfcOpeningElement). - openbim_
ifc_ ⚠v0_ 1_ entity_ get_ value - The value
path(UTF-8, e.g.type.Name,Pset_WallCommon.FireRating) reads from entityid, as a value tape: a scalar or reference as its node, several values as aLIST, a property set as aLISTof two-itemLISTs, each the member’s name (TEXT) and value. - openbim_
ifc_ ⚠v0_ 1_ entity_ inverse_ attribute_ names - Every
INVERSEattribute of entityid, inherited ones first: aLISTofInverseAttributeInforecords, their number inout_count.InverseAttributeInfo: name (TEXT, the schema’s spelling), entity (TEXT, the referencing type beforeFOR), for attribute (TEXT, its attribute afterFOR), aggregate (BOOL: aSETorBAG, read as aLIST), lower (INTEGER), upper (INTEGER, orNULLfor?), declared by (TEXT, the entity introducing it). - openbim_
ifc_ ⚠v0_ 1_ entity_ inverse_ references - Every reference to entity
id, in ascending order: aLISTofInverseReferencerecords, their number inout_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
idtypes, in file order. Refusals as foropenbim_ifc_v0_1_entity_type_object(WrongEntityType: not anIfcTypeObject). - openbim_
ifc_ ⚠v0_ 1_ entity_ openings - Every opening voiding element
id(IfcRelVoidsElement), in file order. Refusals as foropenbim_ifc_v0_1_entity_type_object(WrongEntityType: not anIfcElement). - 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
idwith its relationships: it is taken out of every relationship holding it, and a relationship left without an end goes too. Unlikeopenbim_ifc_v0_1_entity_remove, nothing is left dangling:StillReferencedwhile an entity other than a relationship needsid,MissingEntitywhen there is none. - openbim_
ifc_ ⚠v0_ 1_ entity_ set_ attribute - Set attribute
indexof entityidfrom 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 entityidfrom 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 entityidfrom a one-value tape of plain values, coerced against the attribute’s declared type in the declared release (#342); returns asopenbim_ifc_v0_1_entity_set_attribute_by_namedoes. - openbim_
ifc_ ⚠v0_ 1_ entity_ set_ value - Write a one-value tape of plain values at
path(UTF-8) of entityid, as one transaction: an attribute (Name,type.Name) coerced asopenbim_ifc_v0_1_entity_set_attribute_by_name_plaincoerces it, or a property (Pset_WallCommon.FireRating) from aTYPEDvalue, 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 toout_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 toout_id;NoValuewhen it has none.MissingEntity,WrongEntityType(not anIfcObject),InvalidModel(two types, or a malformed relationship),MissingReference,UnsupportedSchema. - openbim_
ifc_ ⚠v0_ 1_ entity_ voided_ element - The element opening
idvoids (IfcRelVoidsElement), written toout_id;NoValuewhen it voids none. Refusals as foropenbim_ifc_v0_1_entity_type_object(WrongEntityType: not anIfcFeatureElementSubtraction;InvalidModel: two hosts). - openbim_
ifc_ ⚠v0_ 1_ format_ length - Write
value, a length in the unit namedunit, as NUL-terminated text.styleisOPENBIM_IFC_LENGTH_FORMAT_DECIMAL(indisplay_unit, or the value’s unit whendisplay_unitis null, withplacesdecimals),OPENBIM_IFC_LENGTH_FORMAT_FEET_INCHESorOPENBIM_IFC_LENGTH_FORMAT_INCHES(rounded to1/placesof an inch);flags:OPENBIM_IFC_LENGTH_FORMAT_SUPPRESS_ZERO_INCHES. Needs no model.InvalidValuefor a unit name, a zero denominator or a length too large;TypeMismatchfor a unit that is not a length;OutOfRangefor more than 255 decimals;InvalidArgumentfor 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 – intobuffer(capacitybytes), after writing the size needed (its record’s payload size) toout_required; 0 for a product with no graph.OutOfRangefor an index past the set. - openbim_
ifc_ ⚠v0_ 1_ graphs_ records - The set’s
ProductGeometryrecords as a tape, in the order lowered;out_countgets their number.ProductGeometry: id (REF), global id, type name, transform (LISTof 16REALs, column-major, metres, already applied to the graph, orNULL), encoding (jsonorcbor), payload size (INTEGER, bytes), refusal (GeometryRefusalorNULL). 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
modelas its stable code (parse,missing-entity, …), NUL-terminated;NoValueif the last call succeeded. - openbim_
ifc_ ⚠v0_ 1_ last_ error_ message - The last error on
modelas a human message, NUL-terminated;NoValueif the last call succeeded. - openbim_
ifc_ ⚠v0_ 1_ last_ error_ span - The byte range in the query the last error on
modelrefuses, written toout_startandout_end;NoValuewhen the last call succeeded or its error names no span (onlyInvalidSelectordoes). - 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 – intobuffer(capacityvalues), after writing the count needed (3 x triangle count) toout_required.OutOfRangefor an index past the set. - openbim_
ifc_ ⚠v0_ 1_ meshes_ positions - Copy the positions of mesh
index–x, y, zper vertex, metres, relative to its record’s transform – intobuffer(capacityfloats), after writing the count needed (3 x vertex count) toout_required.OutOfRangefor an index past the set. - openbim_
ifc_ ⚠v0_ 1_ meshes_ records - The set’s
ProductMeshrecords as a tape, in the order compiled;out_countgets their number.ProductMesh: id (REF), global id, type name, transform (LISTof 16REALs, column-major, metres, orNULL), vertex count, triangle count (INTEGERs), refusal (GeometryRefusalorNULL), colour (SurfaceColourorNULL), colour refusal (GeometryRefusalorNULL), closure (TEXT, #458:solid,surfacefor an area with no volume, orunknownfor 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_countentitiesidsof modelsourceinto modeltargetwith 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_COLLIDINGor_MERGE.flags:OPENBIM_IFC_APPEND_NO_REUSE_UNITS,_CONTEXTS,_OWNER_HISTORY,_MATERIALS,_STYLES,OPENBIM_IFC_APPEND_DRY_RUN. The answer is aCopyReporttape (see the module docs); a size query or a short buffer plans the append and answersBufferTooSmallwithout 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
GlobalIdisglobal_id(UTF-8,global_lenbytes), written toout_id;NoValuewhen none carries it. - openbim_
ifc_ ⚠v0_ 1_ model_ classifications - The classifications of
object: aLISTofClassificationrecords, its own then its type object’s;out_countgets their number.Classification: relationship (REF), global id, source, type object, target (REF), kind (reference,systemornotation), identification, name, location, notation (LISTofTEXT), parents (LISTofREF), system ([id, name, source, edition]orNULL). - 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_lenUTF-8 bytes): an SIMETREwith any prefix, orinch,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 theLengthUnitReporttape of the module docs; a size query or a short buffer plans the conversion and answersBufferTooSmallwithout applying it. - openbim_
ifc_ ⚠v0_ 1_ model_ convert_ unit_ value - Convert
valuefrom unit entityfromto unit entitytoof the model (anIfcSIUnit,IfcConversionBasedUnitorIfcDerivedUnit), written toout_value.MissingEntity;TypeMismatchfor units of different dimensions;Unsupportedfor a monetary, context-dependent or offset unit;InvalidModelfor a unit that does not resolve;UnsupportedSchema;FeatureDisabled. - openbim_
ifc_ ⚠v0_ 1_ model_ copy_ product - Copy product (or type object)
productwith 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.placementnon-zero places the copy by thatIfcObjectPlacement;offsetnon-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 aCopyReporttape (see the module docs); a size query or a short buffer plans the copy and answersBufferTooSmallwithout applying it. - openbim_
ifc_ ⚠v0_ 1_ model_ cost - Every cost schedule and cost item as one
Costrecord: schedules (LISTofCostSchedule), items (LISTofCostItem, each with itsCostValuetree, 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 oneCREATE. The tape is oneLISTofLIST(TEXT name, value)pairs (an emptyLISTfor none). AnIfcRootwithout aGlobalIdgets a fresh one.out_idgets the new id. - openbim_
ifc_ ⚠v0_ 1_ model_ dangling_ references - Every dangling reference as
(from, to)pairs, flattened: element2kis a referencing id,2k+1the 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
indexas a NUL-terminated string;OutOfRangepast the end. - openbim_
ifc_ ⚠v0_ 1_ model_ diagnostic_ count - Number of non-fatal parse diagnostics.
- openbim_
ifc_ ⚠v0_ 1_ model_ duplicate_ global_ ids - Every
GlobalIdseveral entities carry, inGlobalIdorder, and how many. The tape is aLIST; each item aLISTof theGlobalId(TEXT) and its holders in file order (LISTofREF). Empty for a conformant file.UnsupportedSchema. - openbim_
ifc_ ⚠v0_ 1_ model_ export_ table - The entities selector
query(UTF-8) selects as a table informat(OPENBIM_IFC_TABLE_CSV,_TSV,_XLSX), fillingbufferasopenbim_ifc_v0_1_model_writedoes: the key column first (key:OPENBIM_IFC_TABLE_KEY_AUTOor_GLOBAL_IDforGlobalId,_IDforid), then one column per value path ofcolumns(column_countUTF-8 paths ofcolumn_lengths[i]bytes, e.g.type.Name,Pset_WallCommon.FireRating), each cell the value the path reads as text,NULLasnull(UTF-8, may be empty). - openbim_
ifc_ ⚠v0_ 1_ model_ georeferencing - Every coordinate operation, resolved: a
LISTofMapConversionrecords, empty when the model has none;out_countgets their number.MapConversion: operation, kind, source, source kind, target CRS (ProjectedCrsrecord), eastings, northings, orthogonal height, x axis (twoREALs), scale, factors (threeREALs orNULL), project unit and map unit ([name, metres per unit]), map unit declared (BOOL), linear (three columns of threeREALs), translation (threeREALs). - openbim_
ifc_ ⚠v0_ 1_ model_ header - The file header as a value tape: one
LISTof ten values, in STEP header order – description (LISTofTEXT), 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_lenbytes, case-insensitive). Subtypes are not included. - openbim_
ifc_ ⚠v0_ 1_ model_ ids_ of_ type_ including_ subtypes - Ids of every entity of
type_nameor any of its subtypes, using the schema the file’s header declares.UnsupportedSchemaif none is bundled. - openbim_
ifc_ ⚠v0_ 1_ model_ import_ table - Apply the table
data(data_lenbytes informat) to the model by its key column (key, as foropenbim_ifc_v0_1_model_export_table) as one checked transaction,null(UTF-8) being the cell text ofNULL.flags:OPENBIM_IFC_TABLE_DRY_RUN. The answer is aTableImporttape: applied (BOOL), changes (LISTofTableChange: row, columnINTEGER, key, pathTEXT, entity, target entityREF, target, before, afterTEXT), refusals (LISTofTableRefusal: row, columnINTEGERorNULL, code, messageTEXT, spanLISTof twoINTEGERs orNULL). 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 oneMaterialAssignmentrecord, or aNULLtape when there is none: relationship, global id, source, type object, target, type name, kind, set, name, materials, layers, profiles, constituents (each aLISTof records), usage (record orNULL). - openbim_
ifc_ ⚠v0_ 1_ model_ open - Read the STEP file at
path(UTF-8,path_lenbytes, no NUL needed) into a model that owns its bytes, and write the new model’s handle. An ifcZIP archive is read asopenbim_ifc_v0_1_model_parsereads one. - openbim_
ifc_ ⚠v0_ 1_ model_ open_ mapped - Read the STEP file at
paththrough 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 theOPENBIM_IFC_PARSE_*flags. - openbim_
ifc_ ⚠v0_ 1_ model_ open_ with_ options - As
openbim_ifc_v0_1_model_open, under theOPENBIM_IFC_PARSE_*flags. - openbim_
ifc_ ⚠v0_ 1_ model_ parse - Parse
lenbytes of STEP and write the new model’s handle. - openbim_
ifc_ ⚠v0_ 1_ model_ parse_ ifcxml - Parse
lenbytes 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 theOPENBIM_IFC_PARSE_*flags(0 is the strict read). What a lenient read recovers from is listed byopenbim_ifc_v0_1_model_diagnostic. - openbim_
ifc_ ⚠v0_ 1_ model_ product_ curves - Compile the curves of each product’s
representationas polylines (#458), forids(id_countof them) or, withidsnull andid_count0, every product with a shape, and write the new set’s handle toout_curves.representationisrepresentation_lenbytes of UTF-8:Plan(the best drawing curves:Plan,Annotation,FootPrint, thenAxis, preferring aPLAN_VIEWcontext),Axis,FootPrint,Annotation,Body,SurfaceorReference. Read the set withopenbim_ifc_v0_1_curves_recordsand_curves_positions; destroy it withopenbim_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_countof them) or, withidsnull andid_count0, of every product with a shape, encode each graph in Axiolid’s wire format asencoding(OPENBIM_IFC_GEOMETRY_JSONor_CBOR), and write the new set’s handle toout_graphs. Read it withopenbim_ifc_v0_1_graphs_recordsand_graphs_payload; destroy it withopenbim_ifc_v0_1_graphs_destroy. - openbim_
ifc_ ⚠v0_ 1_ model_ product_ meshes - Compile the Body mesh of each of
ids(id_countof them) or, withidsnull andid_count0, of every product with a shape, and write the new set’s handle toout_meshes. Read it withopenbim_ifc_v0_1_meshes_records,_meshes_positionsand_meshes_indices; destroy it withopenbim_ifc_v0_1_meshes_destroy. - openbim_
ifc_ ⚠v0_ 1_ model_ product_ meshes_ for - As
openbim_ifc_v0_1_model_product_meshes, meshing each product’srepresentation(#458):representation_lenbytes of UTF-8 atrepresentation, one ofBody(as the call above),Plan,Axis,FootPrint,Annotation,SurfaceorReference. Its surfaces and solids are one mesh, whose record’s closure sayssolidorsurface; its curves are left toopenbim_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_countof them) or, withidsnull andid_count0, every product with a shape, in id order. The tape is aLISTofProductPlacementrecords;out_countgets their number.ProductPlacement: id (REF), global id, type name, transform (LISTof 16REALs, a column-major 4x4 in metres, orNULL), representation (SelectedRepresentationorNULL), refusal (GeometryRefusalorNULL).SelectedRepresentation: id, identifier, representation type, context (REForNULL), context type, context identifier, target view.GeometryRefusal: code (unsupported,invalid-model,missing-referenceorbudget-exceeded), entity (REForNULL), message. - openbim_
ifc_ ⚠v0_ 1_ model_ property_ sets - The property sets of
object: aLISTofPropertySetrecords, its own sets first, then those its type object holds;out_countgets their number.PropertySet: id (REF), global id, name, type name, source (occurrenceortype), source id (REForNULL), properties (LISTofProperty).Property: id, name, type name, kind, value type, unit (REForNULL), value (tagged, typed), enumeration, bounds, table, usage, discrimination, quality, members (LISTofProperty). - openbim_
ifc_ ⚠v0_ 1_ model_ property_ sets_ many - The property sets of each of
ids(id_countof them), in that order, or, withidsnull andid_count0, of every object definition (IfcObjectDefinitionand its subtypes) in file order, resolved in one pass through one property index (#358): aLISTofObjectPropertySetsrecords, their number inout_count.ObjectPropertySets: object (REF), sets (LISTofPropertySet, as foropenbim_ifc_v0_1_model_property_sets; empty when refused), refusal (PropertyRefusalorNULL: 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_count0, every resource entity noIfcRootreaches (nor annotates something reached); otherwise entities of theclass_countclasses (UTF-8 names ofclass_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 aRemovalReporttape: removed (LISTofRemovedEntity: idREF, type nameTEXT), kept (LISTofKeptEntity: id, type name, reasonTEXT–shared,related-object,definition,protected– usersLISTofREF), detached and rebased (LISTs ofREF), applied (BOOL, false for a dry run). A size query or a short buffer plans the removal and answersBufferTooSmallwithout 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;HistoryEmptywith nothing to redo. - openbim_
ifc_ ⚠v0_ 1_ model_ remove_ product - Remove product (or type object)
productwith 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 aRemovalReporttape: removed (LISTofRemovedEntity: idREF, type nameTEXT), kept (LISTofKeptEntity: id, type name, reasonTEXT–shared,related-object,definition,protected– usersLISTofREF), detached and rebased (LISTs ofREF), applied (BOOL, false for a dry run). A size query or a short buffer plans the removal and answersBufferTooSmallwithout applying it. - openbim_
ifc_ ⚠v0_ 1_ model_ remove_ property - Remove one property from
object’s own set:openbim_ifc_v0_1_model_set_propertieswith oneREMOVEedit. - openbim_
ifc_ ⚠v0_ 1_ model_ remove_ representation - Remove shape representation
representationwith 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_RUNalone. The answer is theRemovalReporttape ofopenbim_ifc_v0_1_model_remove_product; a size query or a short buffer plans the removal and answersBufferTooSmallwithout applying it. - openbim_
ifc_ ⚠v0_ 1_ model_ resolve_ unit - The effective unit of a
measure_typevalue (IFCAREAMEASURE, UTF-8,measure_lenbytes):unitwhen non-zero (a property’s stated unit), otherwise the project default. The tape is oneResolvedUnit: unit (REForNULL), from project (BOOL), dimensions (LISTof sevenINTEGERs, SI exponents L M T I Θ N J), scale (REAL), offset (REAL). - openbim_
ifc_ ⚠v0_ 1_ model_ schema - The first
FILE_SCHEMAtoken as a NUL-terminated string, orNoValue. - openbim_
ifc_ ⚠v0_ 1_ model_ select - The ids selector
query(UTF-8,query_lenbytes) selects, ascending, fillingbufferasopenbim_ifc_v0_1_model_idsdoes. - openbim_
ifc_ ⚠v0_ 1_ model_ select_ from - As
openbim_ifc_v0_1_model_select, selecting from thebase_countids atbasealone;MissingEntityfor 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
InvalidValueand 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_propertieswith oneSETedit.setandnameare UTF-8; the value is a one-value tape;set_type(IfcPropertySetorIfcElementQuantity) may be null with length 0.out_idgets the entity holding the property. - openbim_
ifc_ ⚠v0_ 1_ model_ spatial_ tree - The spatial containment tree as one
SpatialTreerecord: release (TEXTorNULL), roots (LISTofREF), nodes (LISTofSpatialNode: id, global id, name, type name, kind, parent, children, elements, referenced), orphans, dangling (LISTof[relation, target]), anomalies (LISTof[kind, relation, subject, kept]). - openbim_
ifc_ ⚠v0_ 1_ model_ systems - Every system as one
Systemsrecord: systems (LISTofSystem: id, global id, type name, name, long name, predefined type, members, serviced buildings, serviced facilities) and anomalies (LISTof[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
HistoryChangetape: created, removed and modified (LISTs ofREF) and header (BOOL). A size query or a short buffer peeks the step and answersBufferTooSmallwithout 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.expfile (#538). - openbim_
ifc_ ⚠v0_ 1_ model_ write - Serialize as STEP into a caller buffer;
out_requiredgets the size. - openbim_
ifc_ ⚠v0_ 1_ model_ write_ ifcxml - Serialize as ifcXML into a caller buffer;
out_requiredgets the size.profileas foropenbim_ifc_v0_1_model_parse_ifcxml. An XSD-layout write needs the header to declare the profile’s schema, and refuses withWritewhat the configuration cannot carry. - openbim_
ifc_ ⚠v0_ 1_ model_ write_ ifczip - Serialize as an ifcZIP archive into a caller buffer;
out_requiredgets the size. - openbim_
ifc_ ⚠v0_ 1_ name_ based_ guid - The
GlobalIdnamed byparts(RFC 9562 version 8), NUL-terminated: the same parts give the sameGlobalIdin every binding and release.partsholdspart_countUTF-8 strings ofpart_lengths[i]bytes each. Needs no model;InvalidArgumentfor 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.Unsupportedwhen the system has no random source. - openbim_
ifc_ ⚠v0_ 1_ version - Write the ABI and crate versions.
Type Aliases§
- Openbim
IfcCurves - Opaque handle to a compiled polyline set. Zero is never a valid handle.
- Openbim
IfcGraphs - Opaque handle to an encoded graph set. Zero is never a valid handle.
- Openbim
IfcMeshes - Opaque handle to a compiled mesh set. Zero is never a valid handle.
- Openbim
IfcModel - Opaque model handle. Zero is never a valid handle.