IFC¶
Read IFC identifiers, types, properties and classifications, edit IFC data, and work with IFC file operations and export translators.
Access this group through api.tapir.ifc.
Commands¶
No commands match. Try another name or clear the filter.
For exceptions shared by Unified API commands, see error handling.
get_elements_by_ifc_ids ¶
get_elements_by_ifc_ids(
ifc_ids: list[str],
) -> list[ElementsByIFCId]
Retrieves the elements by the given IFC identifiers. Accepts IFC GlobalIds in every Archicad version.
Parameters:
-
ifc_ids(list[str]) –A list of IFC identifiers to get the corresponding elements for. Each one is either an IFC GlobalId (22 characters) or, before Archicad 28, the 36 character GUID form that GetIFCIdsOfElements returns there as ifcId.
Returns:
-
list[ElementsByIFCId]–A list of elements identified by their IFC identifiers or errors.
get_ifc_assignments ¶
get_ifc_assignments() -> GetIFCAssignmentsResult
Returns the IFC assignments of the project: the root IFC groups, and for each object the objects assigned to it (children) and the objects it is assigned to (parents). Each object is given by its hash value, its element where it belongs to one, its IFC type and its GlobalId. Available from Archicad 28.
Returns:
get_ifc_attributes_of_elements ¶
get_ifc_attributes_of_elements(
elements: list[ElementIdArrayItem],
stored_only: None | bool = None,
) -> list[ElementIFCAttributes | ErrorItem]
Retrieves the IFC attributes (Name, Description, ObjectType, Tag, PredefinedType, LongName, ...) of the given elements, subelements included: the name, the IFC value type and the value of each attribute. On Archicad 25, 26 and 27 storedOnly returns only the attributes stored on the elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
stored_only(None | bool, default:None) –Return only the attributes stored on the elements, not the ones Archicad would generate on IFC export. Used only in Archicad 25, 26 and 27. Default: false.
Returns:
-
list[ElementIFCAttributes | ErrorItem]–A list of the IFC attributes of elements or errors.
get_ifc_classification_references_of_elements ¶
get_ifc_classification_references_of_elements(
elements: list[ElementIdArrayItem],
stored_only: None | bool = None,
) -> list[ElementIFCClassificationReferences | ErrorItem]
Retrieves the IFC classification references of the given elements, subelements included: identification, name, location, description and sort (from Archicad 29), the name of the IfcRelAssociatesClassification (from Archicad 28), the referenced classification (name, source, edition, edition date, description and location) and whether the reference comes from the preview translator or is stored locally. On Archicad 25, 26 and 27 the source is not given and storedOnly returns only the references stored on the elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
stored_only(None | bool, default:None) –Return only the classification references stored on the elements, not the ones Archicad would generate on IFC export. Used only in Archicad 25, 26 and 27. Default: false.
Returns:
-
list[ElementIFCClassificationReferences | ErrorItem]–A list of the IFC classification references of elements or errors.
get_ifc_export_translators ¶
get_ifc_export_translators() -> list[IFCExportTranslator]
Lists the IFC export translators of the project in the order of Archicad's translator list. preview marks the first one, which the Archicad API documents as the preview translator; no API identifies the preview translator otherwise, and in some projects the IFC Translators dialog shows another one as preview. Pass one of the names to IFCFileOperation as translatorName.
Returns:
-
list[IFCExportTranslator]–The IFC export translators of the project, in the order of Archicad's translator list. The first one, which the Archicad API documents as the preview translator, has preview true.
get_ifc_ids_of_elements ¶
get_ifc_ids_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementIFCIds | ErrorItem]
Retrieves the IFC identifiers of the given elements. Before Archicad 28 it also returns their IFC GlobalIds.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementIFCIds | ErrorItem]–A list of the IFC identifiers of elements or errors.
get_ifc_properties_of_elements ¶
get_ifc_properties_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementIFCProperties | ErrorItem]
Retrieves the IFC properties of the given elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementIFCProperties | ErrorItem]–A list of the IFC properties of elements or errors.
get_ifc_spatial_structure ¶
get_ifc_spatial_structure(
elements: None | list[ElementIdArrayItem] = None,
) -> GetIFCSpatialStructureResult
Returns the IfcProject, IfcSite and IfcBuilding objects of the project's IFC model (hash value, IFC type and GlobalId), and for the given elements the index of the story they are assigned to in the IFC model. Available from Archicad 28.
Parameters:
-
elements(None | list[ElementIdArrayItem], default:None) –Elements to get the IFC story index of. Optional.
Returns:
get_ifc_type_of_elements ¶
get_ifc_type_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementIFCType | ErrorItem]
Retrieves the IFC types of the given elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementIFCType | ErrorItem]–A list of the IFC types of elements or errors.
ifc_file_operation ¶
ifc_file_operation(
method: Method,
ifc_file_path: str,
file_type: FileType | None = None,
translator_name: None | str = None,
elements_to_export: IFCElementsToExport | None = None,
*,
overwrite: None | bool = None,
story_index: None | int = None,
) -> SuccessfulExecutionResult
Executes an IFC file operation: opens or merges an IFC file, or saves the project as an IFC file. A save can name the export translator to use, a merge the story the IFC file's first storey is placed on. With overwrite false a save refuses to replace an existing file.
Parameters:
-
method(Method) –The file operation method to use.
-
ifc_file_path(str) –The target IFC file to use. The save method overwrites an existing file, unless overwrite is false.
-
file_type(FileType | None, default:None) –The type of the IFC file. The default is 'ifc'.
-
translator_name(None | str, default:None) –Only for the save method: the name of the IFC export translator to save with, as GetIFCExportTranslators lists them. Without it the save runs with the translator Archicad would offer in its own Save dialog. Needs a fileType of ifc or ifczip (ifc or ifcxml on Archicad 25 and 26).
-
elements_to_export(IFCElementsToExport | None, default:None) –Only for the save method, and only together with translatorName. The default is VisibleElementsOnAllStories.
-
overwrite(None | bool, default:None) –Optional, true by default. Only for the save method: false refuses to save when a file already exists at ifcFilePath, and writes nothing.
-
story_index(None | int, default:None) –Only for the merge method: the story the first storey of the IFC file is placed on, the IFC's other storeys follow on the stories above it. Without it Archicad uses the active story of the floor plan. The active story and the current window are restored after the merge. See GetStories for the valid story indices.
Returns:
remove_ifc_classification_references_of_elements ¶
remove_ifc_classification_references_of_elements(
element_ifc_classification_references: list[
ElementIFCClassificationReferenceRemoval
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes IFC classification references stored on elements, given by the name of their classification and optionally their identification; without identification every stored reference of that classification is removed. Available only in Archicad 25, 26 and 27 for now. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each element that has a matching stored reference gets wouldDelete.
Parameters:
-
element_ifc_classification_references(list[ElementIFCClassificationReferenceRemoval]) –The IFC classification references to remove from the elements. Only references stored on the elements (the ones GetIFCClassificationReferencesOfElements returns with storedOnly) can be removed.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input item, in the order of the input. On a dry run an element that has a stored IFC classification reference of the given classification (and identification, when given) gets wouldDelete.
remove_ifc_classification_references_of_elements_dry_run ¶
remove_ifc_classification_references_of_elements_dry_run(
element_ifc_classification_references: list[
ElementIFCClassificationReferenceRemoval
],
) -> RemoveIFCClassificationReferencesOfElementsResult
Preview this command without applying its changes. Removes IFC classification references stored on elements, given by the name of their classification and optionally their identification; without identification every stored reference of that classification is removed. Available only in Archicad 25, 26 and 27 for now. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each element that has a matching stored reference gets wouldDelete.
Parameters:
-
element_ifc_classification_references(list[ElementIFCClassificationReferenceRemoval]) –The IFC classification references to remove from the elements. Only references stored on the elements (the ones GetIFCClassificationReferencesOfElements returns with storedOnly) can be removed.
Returns:
remove_ifc_properties_of_elements ¶
remove_ifc_properties_of_elements(
element_ifc_properties: list[ElementIFCPropertyRemoval],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes local IFC properties, given by property set and property name, from elements. Available only in Archicad 25, 26 and 27 for now. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each element that has the local IFC property gets wouldDelete.
Parameters:
-
element_ifc_properties(list[ElementIFCPropertyRemoval]) –The local IFC properties to remove.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input item, in the order of the input. On a dry run an element that has the local IFC property gets wouldDelete.
remove_ifc_properties_of_elements_dry_run ¶
remove_ifc_properties_of_elements_dry_run(
element_ifc_properties: list[ElementIFCPropertyRemoval],
) -> RemoveIFCPropertiesOfElementsResult
Preview this command without applying its changes. Removes local IFC properties, given by property set and property name, from elements. Available only in Archicad 25, 26 and 27 for now. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each element that has the local IFC property gets wouldDelete.
Parameters:
-
element_ifc_properties(list[ElementIFCPropertyRemoval]) –The local IFC properties to remove.
Returns:
set_ifc_attributes_of_elements ¶
set_ifc_attributes_of_elements(
element_ifc_attribute_values: list[
ElementIFCAttributeValue
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the values of IFC attributes (Name, Description, ObjectType, Tag, ...) of elements. The attribute must be one GetIFCAttributesOfElements returns for the element; its IFC value type is kept. Available only in Archicad 25, 26 and 27 for now.
Parameters:
-
element_ifc_attribute_values(list[ElementIFCAttributeValue]) –The IFC attribute values to set.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_ifc_classification_references_of_elements ¶
set_ifc_classification_references_of_elements(
element_ifc_classification_references: list[
ElementIFCClassificationReferenceUpdate
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Stores IFC classification references (identification, name, location and the referenced classification with its name, edition, edition date, description and location) on elements. Available only in Archicad 25, 26 and 27 for now.
Parameters:
-
element_ifc_classification_references(list[ElementIFCClassificationReferenceUpdate]) –The IFC classification references to store on the elements.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_ifc_properties_of_elements ¶
set_ifc_properties_of_elements(
element_ifc_property_values: list[
ElementIFCPropertyValue
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets local IFC properties on elements by creating or modifying single value (IfcPropertySingleValue) properties in the given property sets. Available only in Archicad 25, 26 and 27 for now.
Parameters:
-
element_ifc_property_values(list[ElementIFCPropertyValue]) –The IFC property values to set. Only single value (IfcPropertySingleValue) properties are supported.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
Related types¶
These include the parameter and result models used inside the client. The command signatures above show what to pass and what is returned.
GetElementsByIFCIdsParametersGetElementsByIFCIdsResultGetIFCAssignmentsResultGetIFCAttributesOfElementsParametersGetIFCAttributesOfElementsResultGetIFCClassificationReferencesOfElementsParametersGetIFCClassificationReferencesOfElementsResultGetIFCExportTranslatorsResultGetIFCIdsOfElementsParametersGetIFCIdsOfElementsResultGetIFCPropertiesOfElementsParametersGetIFCPropertiesOfElementsResultGetIFCSpatialStructureParametersGetIFCSpatialStructureResultGetIFCTypeOfElementsParametersGetIFCTypeOfElementsResultIFCFileOperationParametersRemoveIFCClassificationReferencesOfElementsParametersRemoveIFCClassificationReferencesOfElementsResultRemoveIFCPropertiesOfElementsParametersRemoveIFCPropertiesOfElementsResultSetIFCAttributesOfElementsParametersSetIFCAttributesOfElementsResultSetIFCClassificationReferencesOfElementsParametersSetIFCClassificationReferencesOfElementsResultSetIFCPropertiesOfElementsParametersSetIFCPropertiesOfElementsResultElementIFCAttributeValueElementIFCAttributesElementIFCClassificationReferenceRemovalElementIFCClassificationReferenceUpdateElementIFCClassificationReferencesElementIFCIdsElementIFCPropertiesElementIFCPropertyRemovalElementIFCPropertyValueElementIFCTypeElementIdArrayItemElementsByIFCIdErrorItemExecutionResultFailedExecutionResultFileTypeIFCElementsToExportIFCExportTranslatorMethodSuccessfulExecutionResult