openbim_ifc
Read, edit and write IFC STEP files.
Python bindings for the openbim-ifc Rust crates (ADR 0013). An
IfcModel holds entities, each a type name plus positional
attributes. Attribute values are the frozen dataclasses in
openbim_ifc.values, which keep every distinction IFC makes -- $
from *, .U. from .F., integer from real, and typed wrappers such
as IFCLENGTHMEASURE(2.5) from their payload -- so a file read and
written back through Python is unchanged.
An Entity view reads and writes attributes by name with plain
Python values (wall.Name), and wall.psets maps property sets
(openbim_ifc.entity).
>>> import openbim_ifc
>>> model = openbim_ifc.open("model.ifc") # doctest: +SKIP
>>> walls = model.by_type("IfcWall") # doctest: +SKIP
Read a STEP (.ifc) file from disk: IfcModel.open().
Convert value between two units named as text (#469): an SI unit
with its prefix written before it ("METRE", "MILLIMETRE",
"MILLI METRE", "SQUARE_MILLIMETRE", "KILOGRAM") or a named
unit of IFC4 Table 673 with exact factors ("inch", "foot",
"square foot", "gallon US", "pound", "degree" ...).
Raises type-mismatch for units of different dimensions,
invalid-value for text that names no unit, and unsupported for a
unit with an offset (degree Fahrenheit, #110).
Write value, a length in unit, as text (#469).
style is "decimal" (in display_unit, default unit, with
places digits, default 2), "feet-inches" (5' - 6 1/2",
rounded to 1/places of an inch, default 8; with
suppress_zero_inches a whole foot is 5') or "inches"
(66 1/2").
A new random GlobalId: an RFC 9562 version-4 UUID from the
operating system's generator, in IFC's 22-character form.
The GlobalId named by parts (RFC 9562 version 8): the same
parts give the same GlobalId in every binding and release, for a
reproducible export. Choose parts unique together, such as a tool name
and a stable key.
Selector query in its canonical form (#464): spacing, quoting
and aliases normalised, so two spellings of one query compare equal.
Raises invalid-selector (with span) when it does not parse
against grammar SELECTOR_GRAMMAR_VERSION.
A GlobalId several entities carry, which the schema forbids:
ids are its holders in file order (IfcModel.duplicate_global_ids()).
A failed IFC operation. code is stable across bindings: parse, write, missing-entity, invalid-value, out-of-range, unsupported-schema, io, unsupported-profile, feature-disabled, invalid-model, missing-reference, budget-exceeded, unsupported, wrong-entity-type, template-violation, missing-property, catalog-not-loaded (JavaScript only: this package embeds the catalog), unknown-attribute, derived-attribute, missing-attribute, still-referenced, type-mismatch, ambiguous-value, invalid-selector (with span, the byte range in the UTF-8 query), inverse-attribute, express-mismatch, invalid-express, history-empty, history-stale.
An IFC model: entities keyed by their #id, in file order.
Failures raise openbim_ifc.IfcError, whose code is one of
parse, write, missing-entity, invalid-value,
out-of-range, unsupported-schema, io,
unsupported-profile, feature-disabled, or, from a domain view,
invalid-model, missing-reference, budget-exceeded,
unsupported or wrong-entity-type, or, from a property edit,
template-violation or missing-property, or, from an attribute
named rather than numbered, unknown-attribute or
derived-attribute, or, from a plain value written by name,
type-mismatch or ambiguous-value, or, from authoring,
missing-attribute or still-referenced, or, from validation
with EXPRESS rules, express-mismatch or invalid-express.
A parsed model decodes each entity the first time it is read: parsing checks every record but builds nothing, so opening a large file is fast and memory holds the file plus what has been touched.
model[id], by_id, by_type, iter(model) and id in model
give openbim_ifc.Entity views (openbim_ifc.entity).
Parse a STEP (.ifc) file from its bytes.
An ifcZIP archive (.ifczip) is recognized by its ZIP signature
and its one model entry read, STEP or ifcXML in either layout,
within a decompression budget: an archive with no model or several
raises parse, an encrypted entry or a compression other than
Stored and Deflate unsupported, and one that inflates past the
budget budget-exceeded.
options relaxes the strict read, e.g. ParseOptions.lenient()
skips damaged records; each one skipped is listed by
diagnostics().
Parse an ifcXML document.
Without xsd_profile it reads this library's lossless layout; with
"IFC4" or "IFC4X3_ADD2" it reads the buildingSMART XSD layout
of that release.
Read a STEP (.ifc) file, or an ifcZIP archive as parse()
reads one, from disk.
Cheaper than IfcModel.parse(Path(path).read_bytes()): the file is
read once, straight into the model, with the GIL released.
mapped=True memory-maps the file instead of reading it: nothing
is copied, and the pages belong to the OS page cache. The model keeps
decoding from the file while it is alive, so the file must not be
modified or truncated until the model is gone -- a truncated file
can terminate the interpreter (SIGBUS), and a rewritten one makes
reads fail or return other content. Use it only for files that stay
put, such as a read-only export.
options is as for parse().
Raises openbim_ifc.IfcError with code == "io" when the
file cannot be read.
Serialize as ifcXML bytes, in the layout parse_ifcxml reads.
An XSD-layout write needs the header to declare the profile's schema
and refuses with write what the layout cannot carry.
Serialize as ifcZIP bytes: one Deflate entry holding STEP
(model.ifc), or, with inner="ifcxml", ifcXML
(model.ifcXML) in the layout xsd_profile names, as for
write_ifcxml(). parse() and open() read it back.
Raises invalid-value for another inner, or an
xsd_profile with STEP inside.
Validate against the schema the header declares.
Findings are sorted by severity, rule, entity and slot.
max_findings caps the report (default 10,000) and sets
truncated when reached.
Validate with the EXPRESS rules of the declared release.
express is the text of that release's .exp file, which the
caller supplies: the schemas are CC BY-ND and not bundled. Every
WHERE, type and global rule is evaluated, and INVERSE cardinality is
checked; indeterminate counts the rules that evaluated to
UNKNOWN. The text is parsed on every call. Raises express-mismatch
for text that declares another schema than the model's or disagrees
with the release's tables, and invalid-express for text that does
not parse. max_findings is as for validate().
The property sets, quantity sets and predefined property sets of
object id: its own first, then those its type object holds, an
occurrence property overriding an inherited one of the same name.
Values keep their declared IFC type, e.g.
Typed("IFCLENGTHMEASURE", Real(0.2)). Resolved against the
release the header declares (IFC2X3, IFC4 or IFC4X3).
property_sets() of each of ids, in that order, or, with
None, of every object definition (IfcObjectDefinition and
its subtypes) in file order, in one pass.
The file's property relationships are validated once for the whole
call rather than once per object, so resolving every object is
linear in the model. Each ObjectPropertySets holds exactly
what property_sets() returns for its object, or, in
refusal, the code and message it raises; only a refusal of the
whole model (unsupported-schema) raises. No index outlives the
call, so a call after an edit sees the edit.
The effective unit of a measure_type value
("IFCAREAMEASURE"): unit when given (a property's stated
unit), otherwise the project default, resolved exactly to SI.
Write and remove property and quantity values as one checked transaction: every edit, in order, or none.
A refused batch raises openbim_ifc.IfcError and leaves the
model unchanged. A write's value is the read side's
Property.value. A value an occurrence inherits from its type
is overridden on the occurrence, never changed on the shared type
set; pass the type object's id to change that. Values are checked
against the declared release (IFC2X3, IFC4 or IFC4X3) and, for a
Pset_/Qto_ set, its PSD/QTO catalog template.
Write one value (set_properties() with one edit); returns
the id of the entity holding it.
Remove one property from object's own set
(set_properties() with one edit).
The spatial containment tree: every container with its parent, sub-containers and contained elements.
Each product's world placement (a column-major 4x4 in metres) and
the Body representation a viewer draws, for ids or every
product with a shape. A product that cannot be placed carries a
typed refusal; the call raises only unsupported-schema or
feature-disabled.
Each product's Body as Axiolid's neutral geometry graph, exact,
for ids or every product with a shape, in Axiolid's versioned
wire format: {"format": "axiolid-geometry-graph", "version":
"1.0", "graph": {"nodes": [...], "roots": [...]}} (the lowest
version the content needs, "1.0" to "1.4"), in world
coordinates, metres. encoding "json" gives the payload as a
str, "cbor" as bytes; any other raises ValueError. A
product that cannot be lowered carries a typed refusal; the call
raises only unsupported-schema or feature-disabled.
Each product's Body as triangles from the reference backend, for
ids or every product with a shape; a product that cannot be
meshed carries a typed refusal. representation meshes
another one instead (#458): "Surface", or any name
product_curves() takes; its curves are left to that call, and
closure says "solid" or "surface". Only a Body mesh
carries a colour. Needs a wheel built with the mesh feature; the
published wheel raises feature-disabled.
Each product's curves as polylines from the reference backend
(#458), for ids or every product with a shape. representation
is "Plan" (the best drawing curves: Plan, Annotation,
FootPrint, then Axis, preferring a PLAN_VIEW context),
or "Axis", "FootPrint", "Annotation", "Body" or
"Surface"; another name raises invalid-value. A product
whose curves cannot be compiled carries a typed refusal: a
curve the reference compiler has no certified polyline for (an
implicit curve, an offset of an offset) is unsupported;
trimmed, composite, offset and intrinsic curves compile (#506).
Text literals and annotation fill areas beside the curves (a
dimension's value) are listed in skipped, not refused (#512).
Needs a wheel
built with the mesh feature.
Every system with its members and served structures, and the memberships the reader could not honour.
Every coordinate operation resolved with the project length
unit; empty when the model has none. IFC2X3 is read from its
ePSet_MapConversion and ePSet_ProjectedCRS property sets.
Ids of every entity of exactly type_name (case-insensitive).
Ids of type_name or any subtype, per the file's schema.
The ids selector query selects, ascending (#464).
"IfcWall, Pset_WallCommon.IsExternal=TRUE + IfcSlab": class
facets (subtypes included) add entities, ! removes them,
attribute, property and type=, material=,
classification=, location= and group= facets filter;
, chains facets and + unites lists. With base, facets
select from those entities alone. The grammar and its differences
from IfcOpenShell's selector are documented in the guide.
Raises invalid-selector (with span, the byte range in the
UTF-8 query) for a query that does not parse or names a class or
attribute the file's release does not declare.
select_ids() as Entity views.
The value path reads from entity (#464): "Name",
"type.Name", "Pset_WallCommon.FireRating",
"materials.Name", "storey.Name", "occurrences.count".
Plain Python values as Entity attributes read them: a
reference is an Entity, $ is None, several values
a tuple, and a property set a read-only mapping of its properties.
Write value at path of entity (#464), as one checked
transaction: an attribute ("Name", "type.Name") coerced as
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 refused write changes
nothing; a path naming no single value raises invalid-value.
The entities selector query selects as a table (#474):
format "csv", "tsv" or "xlsx", the key column first
("GlobalId", or "id" with key="id"), then one column per
value path of columns ("Name", "type.Name",
"Pset_WallCommon.FireRating"), each cell the value the path
reads as text and NULL as null.
Raises invalid-selector for a query or path that does not parse,
invalid-value for an unknown format or key, and
wrong-entity-type for an entity without a GlobalId in a
table keyed by it.
Apply a table (bytes, or str for CSV and TSV) back to the
model by its key column (#474), as one checked transaction: every
other cell is written by its header's value path, typed by the
attribute's declared type or the property's stated one, and a cell
that reads what the model holds changes nothing, so an exported
table imported unchanged is a no-op.
The answer lists every change and every refusal by row and column;
any refusal means nothing was written, as does dry_run.
Raises only for a call that cannot start: an unknown format or key,
bytes that are no table of the format.
The type object of occurrence id (IfcRelDefinesByType),
or None. Raises wrong-entity-type for a non-IfcObject
and invalid-model when the file states two types.
Every attribute of entity id, in declaration order.
Attribute index of entity id; Null past the end.
Set attribute index of entity id; returns the old value.
Every explicit attribute of entity id in slot order,
inherited first, as the release the header declares defines them.
INVERSE attributes hold no slot and are listed by
inverse_attribute_names().
Attribute name of entity id, matched case-insensitively
("Name") and resolved against the declared release; Null
when the record stops before its slot.
An INVERSE name ("IsDefinedBy", #462) reads the entities
referencing id through the release's FOR clause: a List
of Ref for a SET or BAG -- SET [0:1] included, so
ContainedInStructure is a list of zero or one -- in ascending
id order; a Ref or Null for a single-valued inverse
(VoidsElements), which two referrers refuse with
invalid-model.
Every INVERSE attribute of entity id, inherited ones
first, with its FOR clause and bounds, as the declared release
defines them.
Every reference to entity id: the referencing entity and the
attribute index holding the reference, in ascending order, one per
entity and attribute. IfcOpenShell's file.get_inverse(entity,
allow_duplicate=True, with_attribute_indices=True).
How many distinct entities reference entity id, through
any attribute. IfcOpenShell's file.get_total_inverses.
Set attribute name of entity id; returns the old value.
A derived attribute raises derived-attribute, an INVERSE
one inverse-attribute, an unknown name unknown-attribute,
and a refused write changes nothing.
Set attribute name of entity id from a plain Python value,
coerced against the attribute's declared type in the declared
release; returns the old tagged value. wall.Name = "x" calls
this.
A str becomes a label (written bare, 'x') or the enumeration
item it names in any case (.STANDARD.); an int an
INTEGER or a REAL as declared; a float a REAL; a
bool a BOOLEAN or LOGICAL; a list or tuple an aggregate,
element by element; an openbim_ifc.Entity a reference,
checked to exist and to be of an accepted type; None $. In a
SELECT the one member that takes the value is written as its typed
parameter (IFCDESCRIPTIVEMEASURE('by layer')). A tagged value
(Text, Enum, Typed, ...) is written exactly as given.
Raises type-mismatch for a value that does not fit,
ambiguous-value when several SELECT members would take it (the
message names them; pass a Typed value instead), and otherwise
as set_attribute_by_name(). A refused write changes nothing.
Append an entity; returns its new id.
Remove entity id, leaving references to it dangling.
Deprecated since version 0.9:
A file with dangling references parses and is wrong. Use
remove_with_relationships() for one entity, or
remove_product() for a product with what it solely owns.
It keeps working, with a DeprecationWarning.
Create one entity of type_name from named attributes, checked
against the declared release (author() with one
AuthorOp.create()); returns its id.
Remove entity id with the relationships that reference it,
leaving nothing dangling (author() with one
AuthorOp.remove()). Raises still-referenced while an
entity other than a relationship needs it.
Keep at most limit undo entries; 0 (the default) turns
history off and drops what is held. While it is on, every method
that changes the model is one entry (author() is one entry
for its whole batch).
Restore the model to the state before the last change: entities under their ids and at their file positions, the header included. Undoing a creation frees its id again.
Raises history-empty with nothing to undo (also while history is
off) and history-stale when the model changed outside the
history; the model is unchanged then.
Remove product (or type object) id with everything it solely
owns -- its placement, representation, own property and quantity
sets, material usage, openings and ports, and the relationships
left without an end -- as one checked transaction. Shared data
stays: a property set another object uses, a type's representation
maps, a style used elsewhere. The report says what went and what
stayed, and why; with dry_run nothing changes.
Raises still-referenced while other placements are relative to
its placement (rebase_placements re-bases them, composing the
transforms so nothing moves) or while a type object types objects
(untype_occurrences unassigns the type), wrong-entity-type
for an entity that is neither an IfcProduct nor an
IfcTypeObject, and unsupported for a placement that cannot
be re-based.
Remove unreferenced entities as one checked transaction; with
dry_run, only report.
Without classes: every resource entity no IfcRoot reaches
(nor annotates something reached, as a styled item does). With
classes (subtypes included, any case): the entities of those
classes nothing references; an IfcRoot among them only with
include_roots. The owner history with its actors stays unless
include_owner_history. Raises unsupported-schema for a
class the release does not declare.
Remove shape representation id with what only it uses, as
one checked transaction: it is 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, and the report
says why; with dry_run nothing changes.
Raises still-referenced for a representation map an
IfcMappedItem still maps, and wrong-entity-type for an entity
that is not an IfcShapeModel.
Copy product (or type object) id with everything it solely
owns, as one checked transaction (#479): what remove_product()
would remove with it is copied, what it would keep is shared.
Copied, each with a new GlobalId: its placement (relative to the
same parent; moved by offset, in the parent's frame, or
replaced by placement), its representation (items and profiles
copied, the context, styles and type geometry shared), its own
property and quantity sets, its material usage, its ports and, with
openings and fillings, its openings and the doors and
windows filling them. Shared, the copy joining the relationship:
its type, shared property sets, material definitions,
classification and, with container and aggregate, its
spatial container and its whole. The report maps every original to
its copy; with dry_run nothing changes.
Raises wrong-entity-type for neither an IfcProduct nor an
IfcTypeObject, invalid-value for both offset and
placement, and unsupported for an offset onto a placement
that is not a local placement with a Cartesian location, or a moved
copy whose openings or fillings are not placed relative to it.
Copy entities ids of source into this model with what
belongs to them, as one checked transaction (#479): 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 this model's are reused, for the kinds reuse names.
Relationships to objects not copied (a spatial container) are
skipped and reported; relate the copies afterwards.
global_ids: keep (a GlobalId this model holds is
refused), merge (an IfcRoot this model holds by
GlobalId and type is reused, its relationships joined),
regenerate or regenerate-colliding.
Raises unsupported when the models' length or plane angle units
differ (convert one with convert_length_unit() first), unsupported-schema for an entity
this model's release cannot hold (a type or attribute it lacks, a
constant it does not know), invalid-value for a kept
GlobalId this model holds. With dry_run nothing changes.
Convert value from unit entity from_unit to unit entity
to_unit of this model (an IfcSIUnit,
IfcConversionBasedUnit or IfcDerivedUnit), exactly: prefixes
convert by a power of ten, conversion-based units through their
factor, derived units by their exponents.
Raises type-mismatch for units of different dimensions,
unsupported for a monetary or context-dependent unit or one with
an offset (#110), and missing-entity for an id the model lacks.
Convert the model's length unit to target (an SI METRE
with any prefix, such as "MILLIMETRE", or "inch",
"foot", "yard", "mile", "US survey foot"), rescaling
every length, area and volume value -- geometry, placements,
quantities and property values -- as one checked transaction.
Which values are lengths is read from the release's measure types;
values with a unit of their own keep it, and curve parameters that
are angles, knots or multiples stay. With area_and_volume the
area and volume units become the square and cube of the new length
unit; with dry_run nothing changes and the report says what
would.
Raises unsupported naming every value the conversion cannot
carry (a p-curve off a plane, a polynomial curve, a parameter on an
undefined parameter space), invalid-value for a target that is
not a length unit, invalid-model when the project length unit
cannot be resolved and unsupported-schema for a release other
than IFC2X3, IFC4 or IFC4X3. A refusal leaves the model unchanged.
One entity of a model, read and written by attribute name.
wall.Name reads attribute Name as a plain value (see
PlainValue) and wall.Name = "W1" writes it, coerced against
the declared type (Text("W1") writes exactly), both
through the model's attribute_by_name/set_attribute_by_name, so
names match ASCII case-insensitively against the declared release. An
unknown name raises AttributeError, chained from the
unknown-attribute openbim_ifc.IfcError. An INVERSE
name reads too (#462): wall.IsDefinedBy is a tuple of the
relationship Entity views, wall.ContainedInStructure
(SET [0:1]) a tuple of zero or one, and a single-valued inverse
such as opening.VoidsElements an Entity or None;
writing one raises inverse-attribute. The view holds no
data: every read sees the model as it is then. Two views are equal when
they name the same id of the same model.
Whether the entity is a type_name or a subtype of it, per
the file's schema; case-insensitive. A name the schema lacks is
False.
Attribute name as a plain value; entity.Name with the
precise type. Raises openbim_ifc.IfcError as
IfcModel.attribute_by_name() does.
Attribute name as the exact tagged value, e.g.
Typed("IFCLABEL", Text("W1")) or Derived().
Write attribute name (entity.Name = value); returns the
old tagged value. A plain value is coerced against the declared
type (openbim_ifc.IfcModel.set_attribute_by_name_plain());
a tagged one is written as given. A refused write changes
nothing.
Every explicit attribute, in slot order, as
IfcModel.attribute_names() lists them.
Every INVERSE attribute, as
IfcModel.inverse_attribute_names() lists them.
Every entity referencing this one, with the attribute index
holding the reference: IfcModel.inverse_references() as
(Entity, index) pairs.
How many distinct entities reference this one:
IfcModel.total_inverses().
Property sets and predefined property sets by name, each a
read-only mapping of property name to PropertyValue.
The object's own values and those its type object holds, an
occurrence value overriding an inherited one, as
IfcModel.property_sets() resolves them; quantity sets are in
qtos. A snapshot: read it again after a write. Write with
set_property().
Quantity sets (IfcElementQuantity) by name, as psets.
Write one property or quantity value: IfcModel.set_property()
on this entity. value is exact, e.g. Typed("IFCLABEL",
Text("F60")). Returns the id of the entity holding it.
Remove one property from the entity's own set:
IfcModel.remove_property().
One explicit attribute of an entity, from
IfcModel.attribute_names(), as the release the header declares
defines it.
name is the schema's spelling (GlobalId); index its slot,
the index of IfcModel.attribute(). type_name is the
declared type, or an aggregate's element type. A derived attribute
is written * and IfcModel.set_attribute_by_name() refuses it.
declared_by names the entity that introduces it (IfcRoot).
One INVERSE attribute of an entity, from
IfcModel.inverse_attribute_names() (#462), as the release the
header declares defines it: name : SET [lower:upper] OF entity FOR
for_attribute.
entity is the referencing type (its subtypes count too) and
for_attribute its attribute that references this entity, directly
or as an aggregate member. An aggregate inverse (a SET or
BAG, SET [0:1] included) reads as a List; a single-valued
one as a Ref or Null. upper is None for ?;
declared_by names the entity that introduces it (IfcObject).
One reference to an entity, from IfcModel.inverse_references()
(#462): entity id holds it in attribute index, directly or
inside an aggregate.
One operation of IfcModel.author(), built with the class
methods below.
Ids are entity ids or handle() values. attributes map
attribute names (any case) to openbim_ifc.values values. A
builder writes the owner_history it is given on every record it
creates; none is invented, and IFC2X3, which requires one, refuses a
record without.
One entity of type_name from named attributes; an IfcRoot
without a GlobalId gets one.
Replace named attributes; the whole entity is checked again.
The model's one IfcProject.
A spatial element aggregated under parent
(IfcRelAggregates).
A product, contained in container
(IfcRelContainedInSpatialStructure) and typed by
type_object (IfcRelDefinesByType).
A type object (IfcWallType, ...).
IfcRelDefinesByType; an object already typed is refused
unless replace.
When the type already has an IfcRelDefinesByType the objects
join its RelatedObjects and the produced id is that
relationship's; owner_history applies only to a relationship
that is created (#534).
With map_representations the type's RepresentationMaps are
mapped onto each object (IfcMappedItem through
mapping_target or an identity operator); with
material_usage a layer or profile set usage is derived from the
type's set (layer_set_direction "AXIS1".."AXIS3"
overrides the class default); predefined_type is "ignore"
(default), "validate" or "sync". replace unassigns the
previous type and removes what it propagated (#480).
IfcRelContainedInSpatialStructure; an element already
contained is refused unless replace, which moves it out of
its previous container.
IfcRelAggregates; a part already aggregated is refused
unless replace, which moves it out of its previous whole.
An IfcLocalPlacement; axis and ref_direction both or
neither.
An IfcOwnerHistory with its person, organization and
application, through ifc-author.
An IfcShapeRepresentation of items in context,
unassigned. representation_type is checked against the items by
the release's CorrectItemsForType rule, or inferred (the most
specific type admitting them all); identifier defaults to the
context's ContextIdentifier.
Assign a shape representation to a product (its
IfcProductDefinitionShape, created when missing) or to a type
(as a new IfcRepresentationMap). A representation already used
is refused.
Take a shape representation off a product or type; it stays, unassigned, for the batch to assign elsewhere or remove.
A copy of a shape representation with copies of its items, sharing its context, styles and mapped type geometry.
Copy a product or type with what it solely owns (see
IfcModel.copy_product()); produces the copy.
Deep-copy an entity and what it references: classes in
copy are copied, classes in share (and entities a UNIQUE
clause binds) shared; other IfcRoot entities are shared unless
copy_roots, definitions (materials, units, contexts, the owner
history) unless copy_definitions; any other resource is
copied. Produces the copy.
What a committed IfcModel.author() batch did.
ids holds, per operation, the id of the entity it produced, or
None for a removal.
What IfcModel.remove_product() or IfcModel.purge() did,
or, for a dry run (applied false), would do. Every list is in id
order.
An entity IfcModel.remove_product() or IfcModel.purge()
removed: its id and upper-case type.
What IfcModel.undo() or IfcModel.redo() restored:
entities created (absent before, present after), removed and
modified, and whether the file header changed.
How much history IfcModel.history() reports: the bound on undo
entries (limit, 0 while history is off) and the entries
IfcModel.undo() (undo) and IfcModel.redo() (redo)
can step through.
One value IfcModel.import_table() changes (#474).
row and column are one-based, the header being row 1; key
is the row's key and path the column's value path. entity is
the row's entity and target_entity the one written, which a path
such as type.Name finds elsewhere; target is the attribute
name or Set.Property written. before and after are cell
text.
What IfcModel.import_table() planned, and whether it wrote it.
Any refusal means nothing was written; applied is false then, for a
dry run, and for a table that changes nothing.
One refused table, row or cell of IfcModel.import_table().
row and column are one-based and None for the whole table
or row. code is malformed-table, invalid-header,
duplicate-column, no-key-column, ragged-row,
empty-key, unknown-key, duplicate-key, ambiguous-key,
or the error code of a refused write (type-mismatch,
invalid-value, ...). span is the byte range of a header that
does not parse.
An entity a removal reached and kept.
reason is shared (users still need it), related-object
(a type, container or filling: an object of its own), definition (a
material, classification reference, unit, context or owner history,
which only a purge removes) or protected (a purge skipped it: an
IfcRoot or the owner history, unless asked).
What IfcModel.copy_product() or IfcModel.append() did,
or, for a dry run (applied false), would do.
copy is the product's copy (None for an append); copied
every original with its copy, in creation order; reused (append)
the source entities the target already holds; joined the existing
relationships and layers the copies joined; skipped the
relationships of an original the copies do not get; regenerated
(append) the copies given a new GlobalId.
An original and its copy (or, in CopyReport.reused, the
target entity used for it).
What IfcModel.convert_length_unit() did, or, for a dry run
(applied false), would do. from_unit and to name the
project length unit before and after (MILLI METRE, foot); the
factors multiply lengths, areas and volumes (an area or volume factor
is None when that unit did not follow).
Values of one attribute of one entity type that
IfcModel.convert_length_unit() rescaled.
kind is length, area, volume, inverse-length,
inverse-area or map-scale; values counts numbers (a point
has three), entities the entities holding them.
Length-like values of one attribute left as they are, with the
reason: explicit-unit (the value states its own unit),
map-unit (a map coordinate in the CRS's MapUnit),
unitless-parameter (a curve or surface parameter that is an angle,
a knot or a multiple) or unit-not-followed (an area or volume while
the project has no such unit or area_and_volume is off).
The handle of the entity operation index of an
IfcModel.author() batch produces, usable wherever a later
operation of the batch takes an id, attribute values included.
How a STEP read treats damaged input. The defaults are strict.
on_malformed="skip" drops a record that cannot be parsed and reports
it in IfcModel.diagnostics() instead of failing the read.
check_references reports duplicate ids and references to undefined
ids. accept_real_without_point reads 1E-05 as a real.
The STEP file header: FILE_DESCRIPTION, FILE_NAME, FILE_SCHEMA.
Change a field with dataclasses.replace and pass the result to
IfcModel.set_header().
The result of IfcModel.validate() or IfcModel.validate_express().
conformant means no errors and no evaluation errors; unsupported
rules do not count against it. truncated means the finding budget was
reached, so the counts are lower bounds. indeterminate counts EXPRESS
rules that evaluated to UNKNOWN; it is 0 without EXPRESS rules.
One finding. entity is None for the file as a whole.
severity is error, evaluation-error, warning,
indeterminate or unsupported; rule is the check's stable id.
A product no viewer will draw.
reason is not-contained-in-spatial-structure,
no-representation-in-model-context or
representation-without-context; found_views lists the target
views the geometry sits in instead, for the second reason.
A property set, quantity set or predefined property set.
source is occurrence (stated on the object) or type (held by
the type object source_id). An inherited property the occurrence
overrides is left out.
One property, quantity or predefined-set attribute.
kind is value, enumerated, list, bounded, table,
reference or complex. value keeps the declared type:
Typed("IFCLENGTHMEASURE", Real(0.2)). unit is the unit the
property states; IfcModel.resolve_unit() resolves it, or the
project default when it is None.
An IfcPropertyEnumeration: the values an enumerated property permits.
An IfcPropertyBoundedValue's values; Null() when unstated.
An IfcPropertyTableValue.
One row of a PropertyTable.
A measure's effective unit: si = value * scale + offset.
dimensions are the SI exponents (L, M, T, I, Θ, N, J).
One edit for IfcModel.set_properties().
Writes value to property name of set set on object, or,
built with removal(), removes it. value is the read side's
Property.value: a Typed IfcValue (or Null()), a
List of them for an enumerated or list value, a typed measure for a
quantity. set_type ("IfcPropertySet" or "IfcElementQuantity")
names the entity of a set the edit creates that neither the type object
nor the catalog describes.
What a committed IfcModel.set_properties() batch did.
properties holds, per edit, the entity holding the property
afterwards, or None when the batch leaves none.
The containment tree. release is the release containers were
classified against (IFC4_ADD2_TC1), or None for one the tree is
not verified for.
A spatial container. kind is project, site, building,
storey, space or other; elements are contained,
referenced only referenced.
A relationship naming an entity the file lacks.
A second parent or a non-container structure the tree rejected.
A classification that applies to an object.
kind is reference, system or notation (IFC2X3);
source is occurrence or type (via type_object).
parents are the references above a reference, nearest first.
An IfcClassification.
The material association of an object, its own or its type's.
kind is material, list, layer, layer-set,
layer-set-usage, profile, profile-set,
profile-set-usage, constituent or constituent-set.
An IfcMaterial.
An IfcMaterialLayer; thickness in the file's length unit,
is_ventilated a Bool, Unknown or Null value.
An IfcMaterialProfile; profile is its IfcProfileDef.
An IfcMaterialConstituent.
How a layer or profile set is placed.
Every system, and what the reader could not place.
An IfcSystem with its members and the structures it serves.
A membership the systems reader could not honour.
Every cost schedule and cost item.
An IfcCostSchedule; items are the objects assigned to it.
An IfcCostItem; objects are the objects it prices.
An IfcCostValue; applied_value as authored, typed.
The IfcMeasureWithUnit a rate is stated per.
A cost item nested under two parents.
A coordinate operation resolved with the project length unit.
linear maps project metres to map metres as three columns;
translation is where the project origin lands, in map metres.
An IfcProjectedCRS.
A length unit reduced to metres.
One product's world placement and selected Body.
representation is None for a product with no solid
representation (an axis only), which is not a refusal.
The IfcShapeRepresentation selected as a product's Body, and its
context (ContextOfItems).
One product's Body as Axiolid's neutral geometry graph.
payload is the wire envelope, a str for encoding "json"
(json.loads reads it) and bytes for "cbor". The graph is in
world coordinates, metres; transform is the product's placement,
already applied, never to be applied again. No payload and no refusal:
a product with no Body representation.
One product's Body as triangles.
positions holds x, y, z per vertex (array('f'), metres,
relative to transform), indices three vertex indices per
triangle (array('I')). Empty arrays and no refusal: a product with
no Body representation.
colour is the colour the Body's items agree on (#449), None
when nothing colours the product or colour_refusal says why it is
not resolved: code ambiguous (two styled items or two colours at
one level, a layer or profile set of several materials, a constituent
set no shape aspect resolves, or Body items of different colours) or a
shared geometry code. A colour never refuses the mesh.
One product's curves as polylines (#458).
positions holds x, y, z per vertex (array('f'), metres,
relative to transform), every polyline's vertices in turn; each of
polylines names its slice. No polylines and no refusal: a product
without the representation, or one with no curves. skipped lists
the representation's text literals and annotation fill areas by entity
id: not drawn, and not a refusal (#512).
One curve of a ProductCurves, as a slice of its positions:
vertices first_vertex to first_vertex + vertex_count, in the
curve's direction. closed: the last vertex repeats the first.
chord_bound is the certified bound, in metres, on how far the exact
curve lies from the polyline (0.0 for a polyline the file authored);
chord_requested the budget, one millimetre. curve is the IFC
curve, when the lowering names one.
The surface colour a mesh is painted with (#449).
red, green and blue are in [0, 1]; transparency too,
0 opaque, and None when the file states none (which the standard
reads as opaque). source is item, layer or material, in
that precedence; source_entity the IfcStyledItem, the layer
assignment or the IfcMaterial; surface_style the
IfcSurfaceStyle.
$ -- the attribute is not set.
* -- derived in a supertype; distinct from $.
.T. or .F..
.U. -- the third logical state.
An integer literal (64-bit).
A real literal; must be finite.
A string.
A binary literal, as its hex digits.
An enumeration constant, without dots: Enum("ELEMENT").
A reference to entity #id.
An aggregate (list, set, array or bag).
A typed wrapper such as IFCLENGTHMEASURE(2.5).