Skip to content

Attribute

Read and manage Archicad attributes such as layers, surfaces, building materials and pen tables.

Access this group through api.tapir.attribute.

Commands

For exceptions shared by Unified API commands, see error handling.

activate_layer_combination

activate_layer_combination(
    attribute_id: AttributeId,
) -> SuccessfulExecutionResult

Activates the given layer combination in the current window, like choosing it in the Quick Layers palette. Saved views are not changed.

Parameters:

Returns:

consolidate_fills

consolidate_fills() -> ConsolidateFillsResult

Runs the Fill Consolidation menu command of Archicad on the current window, as the menu does, and reports whether it ran together with what Archicad answered. Available from Archicad 27.

Returns:

consolidate_lines

consolidate_lines() -> ConsolidateLinesResult

Runs the Line Consolidation menu command of Archicad on the current window, as the menu does, and reports whether it ran together with what Archicad answered. Available from Archicad 27.

Returns:

create_attribute_folders

create_attribute_folders(
    attribute_folders: list[AttributeFolder],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Creates attribute folders, each given by attribute type and path (the folder names from the root folder down). Missing parent folders are created too; a folder that already exists is kept and reported as success. Available from Archicad 26.

Parameters:

  • attribute_folders (list[AttributeFolder]) –

    A list of attribute folders.

Returns:

create_building_materials

create_building_materials(
    building_material_data_array: list[
        BuildingMaterialData
    ],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Building Material attributes based on the given parameters.

Parameters:

  • building_material_data_array (list[BuildingMaterialData]) –

    Array of data to create new Building Materials.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Building Material if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_composites

create_composites(
    composite_data_array: list[CompositeData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Composite attributes based on the given parameters.

Parameters:

  • composite_data_array (list[CompositeData]) –

    Array of data to create Composites.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Composite if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_fills

create_fills(
    fill_data_array: list[FillData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Fill attributes based on the given parameters.

Parameters:

  • fill_data_array (list[FillData]) –

    Array of data to create new Fills.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Fill if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_graphic_override_combinations

create_graphic_override_combinations(
    graphic_override_combinations: list[
        GraphicOverrideCombinationData
    ],
) -> list[
    ErrorItem | GraphicOverrideCombinationIdArrayItem
]

Creates graphic override combinations from existing rules. Available from Archicad 27.

Parameters:

Returns:

create_graphic_override_rule_groups

create_graphic_override_rule_groups(
    rule_group_names: list[str],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Creates empty graphic override rule groups. Available from Archicad 27.

Parameters:

  • rule_group_names (list[str]) –

    The names of the rule groups to create, unique within the project. The groups are created empty.

Returns:

create_graphic_override_rules

create_graphic_override_rules(
    graphic_override_rules: list[GraphicOverrideRuleData],
) -> list[ErrorItem | GraphicOverrideRuleIdArrayItem]

Creates graphic override rules. The criterion is given as Archicad's criterion XML or as structured conditions. The rule group is created when no rule group has the given name. Available from Archicad 27.

Parameters:

Returns:

create_layer_combinations

create_layer_combinations(
    layer_combination_data_array: list[
        LayerCombinationDataArrayItem
    ],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Layer Combination attributes based on the given parameters.

Parameters:

  • layer_combination_data_array (list[LayerCombinationDataArrayItem]) –

    Array of data to create new Layer Combinations.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Layer Combination if exists with the same guid/index/name. The default is false.

Returns:

create_layers

create_layers(
    layer_data_array: list[LayerData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Layer attributes based on the given parameters.

Parameters:

  • layer_data_array (list[LayerData]) –

    Array of data to create new Layers.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Layer if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_lines

create_lines(
    line_data_array: list[LineData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Line attributes based on the given parameters.

Parameters:

  • line_data_array (list[LineData]) –

    Array of data to create new Lines.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Line if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_mep_systems

create_mep_systems(
    mep_system_data_array: list[MEPSystemData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites MEP System attributes (domain, pens, fill, center line type, surface and insulation surface) based on the given parameters.

Parameters:

  • mep_system_data_array (list[MEPSystemData]) –

    Array of data to create new MEP Systems.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the MEP System if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_pen_tables

create_pen_tables(
    pen_table_data_array: list[PenTableData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Pen Table attributes based on the given parameters.

Parameters:

  • pen_table_data_array (list[PenTableData]) –

    Array of data to create new Pen Tables.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Pen Table if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_profiles

create_profiles(
    profile_data_array: list[ProfileData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Profile attributes as a copy of an existing Profile's geometry, based on the given parameters.

Parameters:

  • profile_data_array (list[ProfileData]) –

    Array of data to create new Profiles.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Profile if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_surfaces

create_surfaces(
    surface_data_array: list[SurfaceData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Surface attributes based on the given parameters.

Parameters:

  • surface_data_array (list[SurfaceData]) –

    Array of data to create new surfaces.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Surface if exists with the same name, or if index is given with the same index. The default is false.

Returns:

create_zone_categories

create_zone_categories(
    zone_category_data_array: list[ZoneCategoryData],
    overwrite_existing: None | bool = None,
) -> list[AttributeIdArrayItem | ErrorItem]

Creates or overwrites Zone Category attributes based on the given parameters.

Parameters:

  • zone_category_data_array (list[ZoneCategoryData]) –

    Array of data to create new Zone Categories.

  • overwrite_existing (None | bool, default: None ) –

    Overwrite the Zone Category if exists with the same name, or if index is given with the same index. The default is false.

Returns:

delete_and_replace_attributes

delete_and_replace_attributes(
    attribute_type: ReplaceableAttributeType,
    attributes: list[DeleteAndReplaceAttributeData],
    dry_run: None | bool = None,
) -> DeleteAndReplaceAttributesResult

Deletes fills, line types, surfaces, building materials, profiles, zone categories or layers and replaces each by another attribute of the same type wherever it was used, like Delete and Replace in the Attribute Manager. Every reference is rewritten to the replacement, the way ReindexAttributes rewrites them: the fields of the elements in the floor plan and in every view and layout, the parameters of library part based elements, their memo data, the tool defaults, the Favorites, the other attributes that refer to it (composites, building materials, surfaces, profiles, MEP systems) and the graphic override rules. A profile is replaced where a wall or a column or beam segment uses the profile structure, and in the Profile parameters of library part based elements; a zone category in zones. A layer is emptied instead, since deleting a layer deletes its elements: every element on it, in the floor plan and in every view and layout, is moved to the replacement layer (as ReindexLayers moves them), then the tool defaults and Favorites on it, and the layer is deleted only once it is empty. The Archicad Layer cannot be deleted, a layer with elements from a hotlinked module is not deleted, and if an element cannot be moved or Archicad does not delete the layer, everything is put back. The sections, elevations, interior elevations and 3D documents that show elements of the deleted layer are listed in viewsToRebuild. Elements on a hidden or locked layer are changed too: their layers are shown and unlocked for the change and put back afterwards (in the current window). If an element cannot be changed (it is locked itself, or not reserved in Teamwork), everything is put back and that attribute is not deleted. Elements from hotlinked modules cannot be changed and are listed. Indices typed into GDL scripts are not found, and the frame and panel classes of curtain wall Favorites and of the Curtain Wall tool default keep the deleted attribute (named in the warnings). If a tool default, Favorite, attribute or rule cannot be rewritten to the replacement, it keeps a copy of the deleted attribute with its name and a new attribute id, named in the warnings. The whole call is one undo step. With dryRun true nothing is changed and no undo step is created: the response has dryRun set to true, and each attribute that passes the checks gets wouldDelete and lists every reference a real run would rewrite (elements, tool defaults, Favorites, other attributes, graphic override rules, elements from hotlinked modules). Available from Archicad 27.

Parameters:

  • attribute_type (ReplaceableAttributeType) –
  • attributes (list[DeleteAndReplaceAttributeData]) –

    The attributes to delete, each with the attribute that takes its place, handled in the given order.

  • dry_run (None | bool, default: None ) –

    If true, the command makes all the checks of a real run and resolves the same targets, with the same errors, but changes nothing in the project and creates no undo step. The response is that of a real run with "dryRun": true added, and says for each target what the real run would do. Default is false.

Returns:

delete_attribute_folders

delete_attribute_folders(
    attribute_folders: list[AttributeFolder],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes attribute folders, each given by attribute type and path, together with all the subfolders and deletable attributes they contain (a folder holding an attribute that cannot be deleted is kept). The root folder cannot be deleted. With dryRun true nothing is deleted: the response has dryRun set to true, and each folder that exists and is not the root folder gets wouldDelete. Available from Archicad 26.

Parameters:

  • attribute_folders (list[AttributeFolder]) –

    A list of attribute folders.

Returns:

  • list[FailedExecutionResult | SuccessfulExecutionResult] –

    One result for each input folder, in the order of the input. On a dry run a folder that is not the root folder and exists gets wouldDelete; Archicad can still refuse to delete a folder that passes these checks.

delete_attribute_folders_dry_run

delete_attribute_folders_dry_run(
    attribute_folders: list[AttributeFolder],
) -> DeleteAttributeFoldersResult

Preview this command without applying its changes. Deletes attribute folders, each given by attribute type and path, together with all the subfolders and deletable attributes they contain (a folder holding an attribute that cannot be deleted is kept). The root folder cannot be deleted. With dryRun true nothing is deleted: the response has dryRun set to true, and each folder that exists and is not the root folder gets wouldDelete. Available from Archicad 26.

Parameters:

  • attribute_folders (list[AttributeFolder]) –

    A list of attribute folders.

Returns:

delete_attributes

delete_attributes(
    attributes_to_delete: list[AttributesToDeleteItem],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes the given attributes. Returns an execution result for each input item. With dryRun true nothing is deleted: the response has dryRun set to true, and each attribute that passes the checks made before deleting (valid attribute type, attribute exists) gets wouldDelete.

Parameters:

Returns:

  • list[FailedExecutionResult | SuccessfulExecutionResult] –

    One result for each input attribute, in the order of the input. On a dry run an attribute that passes the checks made before deleting (valid attributeType, attribute found) gets wouldDelete; Archicad can still refuse to delete an attribute that passes them.

delete_attributes_dry_run

delete_attributes_dry_run(
    attributes_to_delete: list[AttributesToDeleteItem],
) -> DeleteAttributesResult

Preview this command without applying its changes. Deletes the given attributes. Returns an execution result for each input item. With dryRun true nothing is deleted: the response has dryRun set to true, and each attribute that passes the checks made before deleting (valid attribute type, attribute exists) gets wouldDelete.

Parameters:

Returns:

delete_graphic_override_combinations

delete_graphic_override_combinations(
    graphic_override_combination_ids: list[
        GraphicOverrideCombinationIdArrayItem
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes graphic override combinations. Their rules are kept. Available from Archicad 27.

Parameters:

Returns:

delete_graphic_override_rule_groups

delete_graphic_override_rule_groups(
    rule_group_names: list[str],
    move_rules_to_group: None | str = None,
    delete_rules: None | bool = None,
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes graphic override rule groups, found by name. A group that still contains rules is kept unless its rules are moved to another group or deleted with it. Available from Archicad 27.

Parameters:

  • rule_group_names (list[str]) –

    The names of the rule groups to delete.

  • move_rules_to_group (None | str, default: None ) –

    The name of the rule group the rules of the deleted groups are moved to, so they are kept. Created when no rule group has this name.

  • delete_rules (None | bool, default: None ) –

    Delete the rules of the deleted groups too. Without this or moveRulesToGroup, a group that still contains rules is not deleted.

Returns:

delete_graphic_override_rules

delete_graphic_override_rules(
    graphic_override_rule_ids: list[
        GraphicOverrideRuleIdArrayItem
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Deletes graphic override rules. They are also removed from the combinations that contain them. Available from Archicad 27.

Parameters:

Returns:

delete_user_data_of_attributes

delete_user_data_of_attributes(
    attribute_ids: list[AttributeIdArrayItem],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Removes the user data of attributes, every key at once. Archicad does not record this change as an undo step, so Undo does not revert it. With dryRun true nothing is removed: the response has dryRun set to true, and each attribute that exists gets wouldDelete.

Parameters:

Returns:

delete_user_data_of_attributes_dry_run

delete_user_data_of_attributes_dry_run(
    attribute_ids: list[AttributeIdArrayItem],
) -> DeleteUserDataOfAttributesResult

Preview this command without applying its changes. Removes the user data of attributes, every key at once. Archicad does not record this change as an undo step, so Undo does not revert it. With dryRun true nothing is removed: the response has dryRun set to true, and each attribute that exists gets wouldDelete.

Parameters:

Returns:

duplicate_attributes

duplicate_attributes(
    attributes: list[AttributeDuplicationData],
) -> list[DuplicatedAttribute | ErrorItem]

Duplicates attributes of any type that can be created (layers, line types, fills, composites, surfaces, layer combinations, zone categories, profiles, pen tables, MEP systems, operation profiles, building materials), each given by attributeId or by attributeType and attributeIndex, under a new name. The copy gets every setting of the source with its extended definition (composite skins, profile geometry, fill pattern, layer combination and pen table items), its classification items, the values of its custom properties that are not the default, and from Archicad 26 its attribute folder. A new name that is empty or already used by an attribute of the same type is an error item, never a rename; pens and fonts cannot be created, so they are error items too. Archicad chooses the index of the copy (ReindexAttributes can move it) and gives it a new attribute id. What could not be copied (a classification item, a property value, the folder) is listed in the warnings of the copy. Returns one item per input attribute.

Parameters:

  • attributes (list[AttributeDuplicationData]) –

    The attributes to duplicate, of any type that can be created (pens and fonts cannot).

Returns:

get_attribute_indexes

get_attribute_indexes(
    attribute_types: list[AttributeType],
) -> AttributeIndexSummary

Reports for each given attribute type how many attributes there are, the first valid and the highest index in use, and the free indexes between them (for example those of deleted attributes). Available from Archicad 27.

Parameters:

  • attribute_types (list[AttributeType]) –

    The attribute types to report the indexes of.

Returns:

get_attributes_by_type

get_attributes_by_type(
    attribute_type: AttributeType,
) -> AttributeHeadersWrapper

Returns the details of every attribute of the given type, including the path of the attribute folder holding it (Archicad 26 and newer). From Archicad 30 an attribute that Archicad keeps a creation record of also carries creationInfo: how (method), from where (source), by whom and when it was created.

Parameters:

Returns:

get_attributes_from_project

get_attributes_from_project(
    project_file_path: str,
    attribute_types: list[AttributeType],
) -> ProjectAttributes

Reads the attributes of the given types from another project or template file without opening it, for example to compare them with the attributes of the open project. Nothing is imported into the open project. The names are the legacy 8-bit names, so non-ASCII characters may not come through. Archicad does not read Layer, Surface, BuildingMaterial and MEPSystem attributes from a file that is not open: these types get an error item instead of an empty list. Available from Archicad 27.

Parameters:

  • project_file_path (str) –

    The absolute path of the project or template file (for example .pln or .tpl) to read the attributes from.

  • attribute_types (list[AttributeType]) –

    The attribute types to read. Layer, Surface, BuildingMaterial and MEPSystem cannot be read from a file that is not open; they get an error item.

Returns:

get_building_material_physical_properties

get_building_material_physical_properties(
    attribute_ids: list[AttributeIdArrayItem],
) -> list[BuildingMaterialPhysicalPropertiesArrayItem]

Retrieves the physical properties of the given Building Materials.

Parameters:

Returns:

get_building_materials

get_building_materials(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None
    | list[BuildingMaterialAttributeField] = None,
) -> list[BuildingMaterialAttribute | ErrorItem]

Returns the details of the given Building Material attributes.

Parameters:

Returns:

get_composites

get_composites(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[CompositeAttributeField] = None,
) -> list[CompositeAttribute | ErrorItem]

Returns the details of the given Composite attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[CompositeAttributeField], default: None ) –

    Names of the fields to return for each Composite. If omitted, every field is returned.

Returns:

get_current_layer_combination

get_current_layer_combination() -> (
    GetCurrentLayerCombinationResult
)

Returns the layer combination in effect in the current window. No layer combination is returned when the current state of the layers matches none.

Returns:

get_current_pen_table

get_current_pen_table() -> GetCurrentPenTableResult

Returns the current Pen Table (its index, attribute identifier and name) and its number of pens. Pass the returned attributeId to GetPenTables to read the pens.

Returns:

get_fills

get_fills(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[FillAttributeField] = None,
) -> list[ErrorItem | FillAttribute]

Returns the details of the given Fill attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[FillAttributeField], default: None ) –

    Names of the fields to return for each Fill. If omitted, every field is returned. Requesting only the fields you need avoids fetching lineItems/symbolLines/symbolArcs/symbolHotspots, which can be large.

Returns:

get_fonts_by_name

get_fonts_by_name(
    font_names: list[str],
) -> list[ErrorItem | FontDetails]

Finds loaded fonts by name through Archicad's font search and returns their index (as Text and Label fields reference fonts in fontIndex) and name, or an error for a name no loaded font has.

Parameters:

  • font_names (list[str]) –

    Names of the fonts to find, as the Text tool's font list shows them and GetDetailsOfElements reports them in fontName, e.g. 'Arial'.

Returns:

  • list[ErrorItem | FontDetails] –

    One item per name, in the order given: the font found, or an error when no loaded font has the name.

get_graphic_override_combinations

get_graphic_override_combinations() -> list[
    GraphicOverrideCombinationDetails
]

Gets all graphic override combinations of the project with the rules they contain. Available from Archicad 27.

Returns:

get_graphic_override_rule_groups

get_graphic_override_rule_groups() -> list[
    GraphicOverrideRuleGroup
]

Gets all graphic override rule groups of the project with the rules they contain, empty groups included. Available from Archicad 27.

Returns:

get_graphic_override_rules

get_graphic_override_rules(
    *, include_criterion: None | bool = None
) -> list[GraphicOverrideRule]

Gets all graphic override rules of the project, with their rule group, criterion and style. With includeCriterion the criterion also comes as structured conditions, which CreateGraphicOverrideRules and ModifyGraphicOverrideRules take back. Available from Archicad 27.

Parameters:

  • include_criterion (None | bool, default: None ) –

    Also return each rule's criterion as structured conditions ('criterion'), in the shape CreateGraphicOverrideRules and ModifyGraphicOverrideRules take. Default: false.

Returns:

get_graphic_override_rules_by_name

get_graphic_override_rules_by_name(
    graphic_override_rules: list[
        GraphicOverrideRuleReference
    ],
    *,
    include_criterion: None | bool = None,
) -> list[ErrorItem | GraphicOverrideRule]

Gets graphic override rules by name, with their rule group, criterion and style. The rule group narrows the search; without it the rule is searched in every rule group. With includeCriterion the criterion also comes as structured conditions. Available from Archicad 27.

Parameters:

  • graphic_override_rules (list[GraphicOverrideRuleReference]) –

    The graphic override rules to get, by name.

  • include_criterion (None | bool, default: None ) –

    Also return each rule's criterion as structured conditions ('criterion'), in the shape CreateGraphicOverrideRules and ModifyGraphicOverrideRules take. Default: false.

Returns:

get_layer_combinations

get_layer_combinations(
    attributes: list[AttributeIdArrayItem],
) -> list[ErrorItem | LayerCombinationAttribute]

Returns the details of layer combination attributes.

Parameters:

Returns:

get_layer_of_element_defaults

get_layer_of_element_defaults(
    element_types: list[ElementType],
) -> list[ErrorItem | LayersOfElementDefaults]

Returns the layer of the tool defaults of the given element types: the layer new elements of that type are placed on.

Parameters:

  • element_types (list[ElementType]) –

    The element types whose tool defaults are read.

Returns:

  • list[ErrorItem | LayersOfElementDefaults] –

    One item per element type, in the input order: the layer of its tool defaults, or an error when the type is unknown or has no tool defaults.

get_layers

get_layers(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[LayerAttributeField] = None,
) -> list[ErrorItem | LayerAttribute]

Returns the details of the given Layer attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[LayerAttributeField], default: None ) –

    Names of the fields to return for each Layer. If omitted, every field is returned.

Returns:

get_lines

get_lines(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[LineAttributeField] = None,
) -> list[ErrorItem | LineAttribute]

Returns the details of the given Line attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[LineAttributeField], default: None ) –

    Names of the fields to return for each Line. If omitted, every field is returned. Requesting only the fields you need avoids fetching dashItems/lineItems, which can be large.

Returns:

get_mep_systems

get_mep_systems(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[MEPSystemAttributeField] = None,
) -> list[ErrorItem | MEPSystemAttribute]

Returns the details of the given MEP System attributes (domain, pens, fill, center line type, surface and insulation surface).

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[MEPSystemAttributeField], default: None ) –

    Names of the fields to return for each MEP System. If omitted, every field is returned.

Returns:

get_missing_attributes

get_missing_attributes(
    attribute_types: None | list[AttributeUsageType] = None,
    sources: None | list[MissingAttributeSource] = None,
) -> GetMissingAttributesResult

Lists the references of placed elements to layers, fills, surfaces, building materials, composites, profiles, line types, pen tables and zone categories that do not exist in the project, for the given types or all of them, and of the tool defaults, Favorites, graphic override rules, Model View Options combinations and attributes: the structured counterpart of the missing attributes report of Archicad's GDL palette. Every element of the floor plan and of every view and layout (hotlinked ones too) is checked, and so is every tool default and Favorite (with its sub-elements): its layer, its attribute fields and memo data as ReindexAttributes finds them, its composite or profile when its structure type uses one, a drawing's own pen table, and its library part parameters of attribute types; of every graphic override rule the line type, fill and surface it overrides with; of every Model View Options combination the surfaces and line types of the stair and railing schemes and the library part settings' GDL parameters of attribute types; of every composite the building materials of its skins and the line types of its separators, of every building material its cut fill and cut surface, of every surface the fill of its vectorial hatching, of every MEP system its fill, center line type and surfaces, and of every profile the building material, surface or fill of each skin and its contour, cut end and edge line types. The sources input limits the check to elements, tool defaults, Favorites, graphic override rules, Model View Options or attributes. Each item names the source; for an element the element (and the element it is part of, for a curtain wall frame, a column segment, ...) and the story or view it sits on, for a tool default the tool, for a Favorite its name and tool, for a graphic override rule its guid and name, for a Model View Options combination its guid and name (and the library part option set), for an attribute its type, guid and name; then the attribute type, the missing index and the field or GDL parameter that holds it. Index 0 counts as no attribute. Read only. Available from Archicad 27.

Parameters:

  • attribute_types (None | list[AttributeUsageType], default: None ) –

    The attribute types to check. All of them when omitted.

  • sources (None | list[MissingAttributeSource], default: None ) –

    What to check: the placed elements (element), the tool default settings (toolDefault), the Favorites (favorite), the graphic override rules (overrideRule), the Model View Options combinations (modelViewOption) and the attributes that refer to other attributes (attribute: composites, building materials, surfaces, MEP systems and profiles). All of them when omitted.

Returns:

get_pen_tables

get_pen_tables(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[PenTableAttributeField] = None,
) -> list[ErrorItem | PenTableAttribute]

Returns the details of the given Pen Table attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[PenTableAttributeField], default: None ) –

    Names of the fields to return for each Pen Table. If omitted, every field is returned. Requesting only the fields you need avoids fetching the 255-element pens array.

Returns:

get_pens

get_pens(
    indices: None | list[int] = None,
) -> list[ErrorItem | PenTablePen]

Returns the given pens, or all of them, in effect in the current window: index, color, width and description. It also works when the pens in effect are not a Pen Table attribute. Available from Archicad 27.

Parameters:

  • indices (None | list[int], default: None ) –

    The indices of the pens to return, from 1 to the number of pens (GetCurrentPenTable returns penCount). If omitted, every pen is returned.

Returns:

  • list[ErrorItem | PenTablePen] –

    The pens in effect in the current window, or errors. The order is that of the given indices.

get_profiles

get_profiles(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[ProfileAttributeField] = None,
) -> list[ErrorItem | ProfileAttribute]

Returns the details of the given Profile attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[ProfileAttributeField], default: None ) –

    Names of the fields to return for each Profile. If omitted, every field is returned. Note the raw cross-section vector geometry itself is not exposed; width/height/minimumWidth/minimumHeight/widthStr etchable/heightStretchable/stretchZones/hasCoreSkin/profileModifiers are derived measurements matching what the Profile Editor shows, computed from the profile's internal stretch/parameter data.

Returns:

get_surfaces

get_surfaces(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[SurfaceAttributeField] = None,
) -> list[ErrorItem | SurfaceAttribute]

Returns the details of the given Surface attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[SurfaceAttributeField], default: None ) –

    Names of the fields to return for each Surface. If omitted, every field is returned.

Returns:

get_unused_attributes

get_unused_attributes(
    types: None | list[AttributeUsageType] = None,
) -> GetUnusedAttributesResult

Lists the unused layers, fills, surfaces, building materials, composites, profiles, line types, pen tables and zone categories (index, id and name), for the given types or all of them. The Archicad API has no function that tells which attributes are unused (only how many per type), so every reference is collected: the elements of the floor plan and of every view and layout (hotlinked ones too), with their library part parameters and memo data, the tool defaults, the Favorites, the other attributes (composites, building materials, surfaces, profiles, MEP systems) and the graphic override rules, the way ReindexAttributes finds them; for layers the layer of each element, tool default and Favorite; for composites and profiles the walls, slabs, roofs, shells, column and beam segments whose structure type uses them; for pen tables the current pen table and the drawings set to a pen table of their own. An attribute that only an unused attribute refers to counts as used. Indices typed into GDL scripts and the pen tables saved with views are not found. Each type also reports Archicad's own count of the attributes in use (archicadUsedCount, see GetUsedAttributes), so a difference shows. Read only. Available from Archicad 27.

Parameters:

  • types (None | list[AttributeUsageType], default: None ) –

    The attribute types to check. All of them when omitted.

Returns:

get_used_attributes

get_used_attributes() -> GetUsedAttributesResult

Gets how many attributes of each type are in use (layers, lines, fills, composites, surfaces, ...), as Archicad reports them for the usedAttributes JSON query: the counts in usedAttributes, the report as text in raw. Available from Archicad 27.

Returns:

get_user_data_of_attributes

get_user_data_of_attributes(
    attribute_ids: list[AttributeIdArrayItem],
) -> list[AttributeUserData | ErrorItem]

Reads the key-value pairs stored on attributes by SetUserDataOfAttributes. An attribute without user data returns no pairs; one holding user data in another layout returns an error.

Parameters:

Returns:

  • list[AttributeUserData | ErrorItem] –

    One item per attribute, in the input order: the pairs stored on the attribute (none when it holds no user data), or an error when the attribute was not found or holds user data in another layout.

get_zone_categories

get_zone_categories(
    attribute_ids: list[AttributeIdArrayItem],
    fields: None | list[ZoneCategoryAttributeField] = None,
) -> list[ErrorItem | ZoneCategoryAttribute]

Returns the details of the given Zone Category attributes.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • fields (None | list[ZoneCategoryAttributeField], default: None ) –

    Names of the fields to return for each Zone Category. If omitted, every field is returned.

Returns:

import_attributes_from_project

import_attributes_from_project(
    project_file_path: str,
    attribute_types: list[AttributeType],
    attribute_names: None | list[str] = None,
    overwrite_existing: None | bool = None,
    dry_run: None | bool = None,
    references_by_index: None | bool = None,
) -> ImportedAttributesByType

Imports Line, Fill, ZoneCategory, PenTable, OperationProfile, Composite, Profile and LayerCombination attributes from another project or template file into the open project, with their complete definition (symbol and percent fills included), like Append or Overwrite by name in Archicad's Attribute Manager. The lines and fills a composite or profile uses are matched by name; its building materials and surfaces, and the layers of a layer combination, keep their index only with referencesByIndex, since Archicad does not read these types from a closed file. An attribute with a reference that cannot be mapped is not imported. A new attribute gets a new guid: Archicad does not hand out the guids stored in the source file. An attribute whose name already exists is skipped, or overwritten in place with overwriteExisting. dryRun reports what would happen without changing anything. The names are the legacy 8-bit names of the source file. Available from Archicad 27.

Parameters:

  • project_file_path (str) –

    The absolute path of the project or template file (for example .pln or .tpl) to import the attributes from.

  • attribute_types (list[AttributeType]) –

    The attribute types to import, in this order. Line, Fill, ZoneCategory, PenTable, OperationProfile, Composite, Profile and LayerCombination can be imported. Layer, Surface, BuildingMaterial and MEPSystem fail with an error item: Archicad does not read them from a closed file. A Composite, Profile or LayerCombination refers to other attributes, see referencesByIndex; list Line and Fill before them to import the lines and fills they use.

  • attribute_names (None | list[str], default: None ) –

    Import only the attributes with these names. All attributes of the given types are imported when it is omitted.

  • overwrite_existing (None | bool, default: None ) –

    What happens to an attribute whose name already exists in the open project. false (default): it is skipped and the existing attribute is kept. true: the existing attribute is overwritten with the imported definition and keeps its index and guid.

  • dry_run (None | bool, default: None ) –

    If true, nothing is changed: the response reports what an import would do.

  • references_by_index (None | bool, default: None ) –

    How the BuildingMaterial, Surface and Layer references of an imported Composite, Profile or LayerCombination are mapped. Archicad does not read these attributes from a closed file, so their names are unknown and they cannot be matched by name. false (default): an attribute with such a reference is not imported (result failed). true: the reference keeps its index and refers to the attribute with that index in the open project, which is right only when both files share these attributes at the same indexes, for example because they come from the same template. Line and Fill references are always matched by name.

Returns:

modify_graphic_override_combinations

modify_graphic_override_combinations(
    graphic_override_combinations: list[
        GraphicOverrideCombinationModificationData
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Modifies the name and/or the rules of graphic override combinations. Omitted fields are kept. Available from Archicad 27.

Parameters:

Returns:

modify_graphic_override_rules

modify_graphic_override_rules(
    graphic_override_rules: list[
        GraphicOverrideRuleModificationData
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Modifies the name, criterion or style of graphic override rules. The criterion is given as Archicad's criterion XML or as structured conditions. A given style replaces the whole style of the rule. Available from Archicad 27.

Parameters:

Returns:

modify_layers

modify_layers(
    layers: list[LayerModificationData],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Changes the given settings of existing layers: shown or hidden, locked, wireframe, the intersection group and the name. Only the given fields of a layer are changed; every other setting is kept, so unlike CreateLayers with overwriteExisting the whole layer need not be given. Archicad keeps the shown, locked and wireframe state of a layer per open window; like CreateLayers, this changes it in the current window. A name must not be empty or used by another layer, and the built-in Archicad Layer cannot be renamed. Each layer gets its own execution result. In a Teamwork project the LayerSettingsDialog lockable object set must be reserved first (see ReserveLockableObjectSet).

Parameters:

  • layers (list[LayerModificationData]) –

    The layers to change. Only the given fields of a layer are changed; every other setting of it is kept.

Returns:

modify_pens

modify_pens(
    pens: list[PenData], target: None | PenTarget = None
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Changes the color, width and description of single pens of the Pen Table in effect for the model views (the default) or the layouts, keeping every other pen as it is. Only the given fields of a listed pen are changed. In a Teamwork project the PenTables lockable object set must be reserved first (see ReserveLockableObjectSet).

Parameters:

  • pens (list[PenData]) –

    The pens to change in the active Pen Table. Only the given fields (color, width, description) of a listed pen are changed; every other pen of the table is left as it is.

  • target (None | PenTarget, default: None ) –

Returns:

move_attributes_and_folders

move_attributes_and_folders(
    target_folder: AttributeFolder,
    attribute_ids: None | list[AttributeIdArrayItem] = None,
    attribute_folders: None | list[AttributeFolder] = None,
) -> MoveAttributesAndFoldersResult

Moves attributes and attribute folders (with their contents) into the target folder, which must be of the same attribute type; an empty target path is the root folder. Returns one execution result per attribute and per folder; an attribute or folder that is already directly in the target folder counts as moved. Available from Archicad 26.

Parameters:

  • target_folder (AttributeFolder) –

    The folder to move the attributes and folders into. An empty path is the root folder.

  • attribute_ids (None | list[AttributeIdArrayItem], default: None ) –

    The attributes to move. They must have the attribute type of the target folder.

  • attribute_folders (None | list[AttributeFolder], default: None ) –

    The folders to move, with their contents. They must have the attribute type of the target folder.

Returns:

move_graphic_override_rules

move_graphic_override_rules(
    graphic_override_rules: list[GraphicOverrideRuleMove],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Moves graphic override rules to another rule group, or to another place in their own group. Available from Archicad 27.

Parameters:

Returns:

reindex_attributes

reindex_attributes(
    attribute_type: ReindexableAttributeType,
    attributes: list[AttributeReindexData],
    dry_run: None | bool = None,
    max_placeholders: None | int = None,
) -> list[AttributeReindexResult | ErrorItem]

Moves fills, line types, surfaces, building materials and zone categories to new indices, the way ReindexLayers moves layers. Archicad cannot renumber an attribute, so the attribute is recreated at its new index (free indices below it are filled with temporary attributes, which are deleted again) and every reference to the old index is rewritten to the new one: the fields of the elements in the floor plan and in every view and layout, the parameters of library part based elements, the memo data of roofs, slabs, meshes, morphs, curtain walls, beams, columns, stairs and interior elevations, the tool defaults, the Favorites (with their sub-elements: a curtain wall's frame and panel classes, a stair's structures), the other attributes that refer to it (composites, building materials, surfaces, profiles, MEP systems) and the graphic override rules. Only then is the old attribute deleted. The new attribute has a new attribute id (Archicad does not keep a given id); its name, definition and attribute folder are the old ones. Elements on a hidden or locked layer cannot be changed, so their layers are shown and unlocked for the move and put back afterwards (in the current window, as Archicad keeps these flags per window). If an element still cannot be changed (it is locked itself, or not reserved in Teamwork), everything is put back and that attribute is not moved. Elements from hotlinked modules cannot be changed and are listed; their module file has to be reindexed on its own. Indices typed into GDL scripts are not found, and the frame and panel classes of curtain wall Favorites and of the Curtain Wall tool default keep the old index (Archicad does not take them from ACAPI_Favorite_Change, so such Favorites are left as they are and named in the warnings). dryRun lists every reference without changing anything. The whole call is one undo step. Pens, layers (see ReindexLayers) and the other attribute types are not supported. Available from Archicad 27.

Parameters:

  • attribute_type (ReindexableAttributeType) –
  • attributes (list[AttributeReindexData]) –

    The attributes to move to a new index, handled in the given order.

  • dry_run (None | bool, default: None ) –

    Only list every reference to each attribute (elements, tool defaults, Favorites, other attributes, graphic override rules, elements from hotlinked modules) without changing anything. The default is false.

  • max_placeholders (None | int, default: None ) –

    Every free index below newIndex is filled with a temporary attribute first, so a newIndex far above the highest index in use takes long. An attribute that needs more temporary attributes than this is not moved. The default is 1000.

Returns:

reindex_layers

reindex_layers(
    layers: list[Layer],
    dry_run: None | bool = None,
    max_placeholders: None | int = None,
) -> list[ErrorItem | Layers]

Moves layers to new indices. Archicad cannot renumber an attribute, so each layer is recreated at its new index (free indices below it are filled with temporary layers, which are deleted again), gets the old layer's state in every layer combination, and then every element of the old layer is moved to it, in the floor plan and in every view and layout database, with the tool defaults on that layer. Only when the old layer is empty everywhere is it deleted, and the new layer gets its name, flags and folder. If an element cannot be moved (it is locked, not reserved in Teamwork, or comes from a hotlinked module), that layer is left as it was. The new layer has a new attribute id; Favorites that use the layer are not updated. Archicad keeps the shown, locked and wireframe state of a layer per open window: the new layer gets the old one's state in the current window and in every layer combination, and starts shown and unlocked in the other open windows. The model elements that sections, elevations, interior elevations and 3D documents show of the layer come back on the new layer when those views are rebuilt (listed as viewsToRebuild). dryRun lists the elements and tool defaults on each layer without changing anything. The whole call is one undo step. Available from Archicad 27.

Parameters:

  • layers (list[Layer]) –

    The layers to move to a new index, handled in the given order.

  • dry_run (None | bool, default: None ) –

    Only list what would change (the elements on each layer, the tools whose default layer it is, the elements that block the move) without changing anything. The default is false.

  • max_placeholders (None | int, default: None ) –

    Every free index below newIndex is filled with a temporary layer first (about 20 ms each), so a newIndex far above the highest index in use takes long. A layer that needs more temporary layers than this is not moved. The default is 1000.

Returns:

  • list[ErrorItem | Layers] –

    One item per requested layer, in the same order.

rename_attribute_folders

rename_attribute_folders(
    attribute_folders: list[AttributeFolderRename],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Renames attribute folders, each given by attribute type and path, to the given new names. The root folder cannot be renamed. Available from Archicad 26.

Parameters:

  • attribute_folders (list[AttributeFolderRename]) –

    The folders to rename, each given by attribute type and path together with its new name.

Returns:

rename_attributes

rename_attributes(
    attributes: list[AttributeRename],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Renames attributes of any type (layers, layer combinations, composites, surfaces, ...). Each attribute keeps its index, its id and its settings. A new name that another attribute of the same type already has is refused, and so is renaming the attributes Archicad does not allow to change (the built-in Archicad Layer, the Solid and Empty fills).

Parameters:

  • attributes (list[AttributeRename]) –

    The attributes to rename, of any type.

Returns:

rename_graphic_override_rule_groups

rename_graphic_override_rule_groups(
    rule_groups: list[GraphicOverrideRuleGroupRename],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Renames graphic override rule groups, found by name. Their rules are kept. Available from Archicad 27.

Parameters:

Returns:

set_graphic_override_rule_group_order

set_graphic_override_rule_group_order(
    rule_group_names: list[str],
) -> SuccessfulExecutionResult

Sets the order of the graphic override rule groups, found by name. The groups not listed keep their order and follow the listed ones. Available from Archicad 27.

Parameters:

  • rule_group_names (list[str]) –

    The names of the rule groups in their new order. The groups not listed keep their order and follow the listed ones. Built-in groups, like the Renovation group, cannot be listed and keep their place.

Returns:

set_graphic_override_rule_order

set_graphic_override_rule_order(
    graphic_override_rule_groups: list[
        GraphicOverrideRuleOrder
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Sets the order of the rules in graphic override rule groups, found by name. The listed rules come first, in the given order; the other rules of the group keep their order after them. Available from Archicad 27.

Parameters:

  • graphic_override_rule_groups (list[GraphicOverrideRuleOrder]) –

    The rule groups to reorder, in the shape GetGraphicOverrideRuleGroups returns them.

Returns:

set_layer_of_element_defaults

set_layer_of_element_defaults(
    layers_of_element_defaults: list[
        LayersOfElementDefault
    ],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Sets the layer of the tool defaults of the given element types, so new elements of that type are placed on it. Only the layer of the defaults is changed.

Parameters:

  • layers_of_element_defaults (list[LayersOfElementDefault]) –

    The element types whose tool defaults get a new layer.

Returns:

set_pens

set_pens(
    pens: list[PenData],
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Changes the color, width and description of the given pens in effect in the current window, the pens GetPens returns, in one undo step. Only the given fields of a listed pen are changed; each pen gets its own execution result. In a Teamwork project the PenTables lockable object set must be reserved first (see ReserveLockableObjectSet). Available from Archicad 27.

Parameters:

  • pens (list[PenData]) –

    The pens to change among the pens in effect in the current window, the ones GetPens returns. Only the given fields (color, width, description) of a listed pen are changed.

Returns:

set_user_data_of_attributes

set_user_data_of_attributes(
    attribute_ids: list[AttributeIdArrayItem],
    pairs: None | list[UserDataPair] = None,
    keys_to_delete: None | list[str] = None,
) -> list[
    FailedExecutionResult | SuccessfulExecutionResult
]

Stores string values under keys in the user data of attributes, for scripts to keep their own state on an attribute. The given pairs are merged into what each attribute already holds: a key that exists gets the new value, other keys are left as they are, and the keys listed in keysToDelete are removed. Prefix the keys with the script's name so that scripts do not overwrite each other's data. User data in another layout is left unchanged and reported as an error. Archicad does not record this change as an undo step, so Undo does not revert it.

Parameters:

  • attribute_ids (list[AttributeIdArrayItem]) –

    A list of attributes.

  • pairs (None | list[UserDataPair], default: None ) –

    The key-value pairs to store on each attribute. A key the attribute already holds gets the new value; other keys are left as they are.

  • keys_to_delete (None | list[str], default: None ) –

    The keys to remove from the user data. A key that is not stored is ignored. Applied after pairs.

Returns:

These include the parameter and result models used inside the client. The command signatures above show what to pass and what is returned.