Element¶
Find, inspect, select and transform existing elements, including their geometry and element-specific settings.
Access this group through api.tapir.element.
Commands¶
No commands match. Try another name or clear the filter.
For exceptions shared by Unified API commands, see error handling.
align_elements ¶
align_elements(
elements: list[ElementIdArrayItem],
align_to: AlignTo,
reference: ElementId | None = None,
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Aligns elements on the floor plan or in the current 2D view to one edge of their plan bounding boxes (left, right, top or bottom) or to their middle (centerX, centerY), either of the whole set or of a reference element, by moving them in one undo step. The bounding boxes are those Get2DBoundingBoxes returns. Supported types: Wall, Column, Beam, Slab, Roof, Shell, Morph, Mesh, Zone, Object, Lamp, Stair, Railing, CurtainWall, Line, PolyLine, Arc, Circle, Spline, Hatch, Text and Hotspot. An element of another type (doors, windows and openings, which only slide along their host, subelements, dimensions, labels, ...) or one that cannot be edited gets a failed execution result naming the reason, and the other elements are still aligned.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to align: Wall, Column, Beam, Slab, Roof, Shell, Morph, Mesh, Zone, Object, Lamp, Stair, Railing, CurtainWall, Line, PolyLine, Arc, Circle, Spline, Hatch, Text or Hotspot, in the current database.
-
align_to(AlignTo) –The edge of the plan bounding boxes to align: left (smallest X), right (largest X), bottom (smallest Y), top (largest Y), centerX (the middle in X, so the elements line up on one vertical line) or centerY (the middle in Y, on one horizontal line).
-
reference(ElementId | None, default:None) –Optional element to align to; it is not moved itself. Without it the elements are aligned to the outermost edge of the whole set (its leftmost left edge, its topmost top edge, ...), or for centerX and centerY to the middle of the bounding box of the whole set.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
capture_element_state ¶
capture_element_state(
type: ElementStateType | None = None,
) -> CaptureElementStateResult
Captures the current state of the elements of the project and returns a stateId for it, so that GetElementChangesSince can later list what was created, modified and deleted since. The optional type selects how changes are detected (modification stamps by default, or the 3D model). The state is kept in a file in the temporary folder for the Archicad session only: it is lost when the project is closed or Archicad restarts, and ReleaseElementState frees it earlier.
Parameters:
-
type(ElementStateType | None, default:None) –
Returns:
change_library_part_of_elements ¶
change_library_part_of_elements(
elements_with_library_part: list[
ElementLibraryPartChange
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Changes the library part of the given Object, Lamp, Window, Door, Skylight, Zone and symbol Label elements to another library part of the same type (Wall End parts for wall ends), given by name, index or guid, e.g. to replace missing library parts with ones from the loaded libraries. The elements themselves (guid, properties, classifications) are kept. Components of stairs and railings are not supported, even when they are reported as Objects. Optionally keeps the values of the GDL parameters with the same name and type, and the size (A and B).
Parameters:
-
elements_with_library_part(list[ElementLibraryPartChange]) –The elements with the library part to change them to. Components of stairs and railings are not supported, even when they are reported as Objects.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
change_selection_of_elements ¶
change_selection_of_elements(
add_elements_to_selection: None
| list[ElementIdArrayItem] = None,
remove_elements_from_selection: None
| list[ElementIdArrayItem] = None,
) -> ChangeSelectionOfElementsResult
Adds/removes a number of elements to/from the current selection.
Parameters:
-
add_elements_to_selection(None | list[ElementIdArrayItem], default:None) –A list of elements.
-
remove_elements_from_selection(None | list[ElementIdArrayItem], default:None) –A list of elements.
Returns:
change_text_content ¶
change_text_content(
content_changes: list[TextContentChange],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Replaces a range of the content of Text elements and text Labels, keeping the styles of the runs and the autotexts in the rest of the content.
Parameters:
-
content_changes(list[TextContentChange]) –The content changes, applied in order (several changes of one element see the content as the previous one left it). Unlike ModifyTexts/ModifyLabels, the rest of the content is not rebuilt: the other runs, their styles and any autotext in them stay as they are, and the inserted piece takes the style of the character at 'from'.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
convert_reveal_offsets ¶
convert_reveal_offsets(
openings: list[OpeningRevealOffsetData],
) -> list[ErrorItem | OpeningRevealOffsets]
Converts the reveal depth offset of windows and doors placed in walls between the two references Archicad uses: measured from the core skin of a composite wall, or from the wall side. Give exactly one of coreOffset or sideOffset per opening; both values are returned. For walls with a basic structure the two values are equal. The output is aligned with the input array of openings. Available from Archicad 27.
Parameters:
-
openings(list[OpeningRevealOffsetData]) –Windows and doors placed in walls, each with exactly one of coreOffset or sideOffset.
Returns:
-
list[ErrorItem | OpeningRevealOffsets]–The reveal depth offset of each opening in both references, aligned with the input, or an error.
copy_elements ¶
copy_elements(
elements: list[ElementIdArrayItem],
offset: Coordinate3D,
count: None | int = None,
) -> list[Copy]
Copies elements by an offset, like dragging a copy in Archicad, keeping all their settings. With count, copy n is moved by n times the offset, which makes a linear array. Returns the new elements of each given element, in the order of the given ones; an element Archicad cannot copy (a part of a curtain wall, stair or railing, a locked element or one on a hidden or locked layer, ...) gets an error naming the reason, and the other elements are still copied. All copies are one undo step.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to copy.
-
offset(Coordinate3D) –The vector in meters the first copy is moved by from its element.
-
count(None | int, default:None) –Optional number of copies of each element. Copy n is moved by n times the offset, so more than one makes a linear array. By default it's 1.
Returns:
-
list[Copy]–One item for each given element, in the same order.
copy_elements_to_database ¶
copy_elements_to_database(
elements: list[ElementIdArrayItem],
target_database_id: DatabaseId,
source_database_id: DatabaseId | None = None,
offset: Coordinate2D | None = None,
) -> list[ElementIdArrayItem | ErrorItem]
Copies 2D elements (lines, polylines, arcs, circles, splines, hotspots, texts, hatches, independent labels) from one database into another, e.g. from a worksheet into another worksheet, a detail or a layout, optionally moved by an offset. Returns the new elements in the order of the given ones.
Parameters:
-
elements(list[ElementIdArrayItem]) –The 2D elements to copy: Line, PolyLine, Arc, Circle, Spline, Hotspot, Text, Hatch or Label (not associated with an element). Drawings are not copied yet: created from their own data they lose the link to their source view.
-
target_database_id(DatabaseId) –The database to copy the elements into, e.g. a worksheet, a detail or a layout (see GetDatabases).
-
source_database_id(DatabaseId | None, default:None) –The database the elements are in. Default is the current database.
-
offset(Coordinate2D | None, default:None) –Optional vector the copies are moved by in the target database. Without it they keep the coordinates of the originals.
Returns:
-
list[ElementIdArrayItem | ErrorItem]–The new element of each given element, in the same order, or the reason it was not copied.
delete_elements ¶
delete_elements(
elements: list[ElementIdArrayItem],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Deletes elements, each in the database that contains it (the floor plan, a section, a worksheet, a layout, ...), whichever window is the current one; the current window stays. The zones of the call are deleted before all the other elements, so an automatic zone deleted together with its bounding walls is gone before its boundary is; deleting the boundary of an automatic zone without the zone itself can open Archicad's modal 'No closed polygon found' dialog, which blocks the command until someone clicks it in Archicad. Returns an execution result for each input element: an element that could not be deleted (for example because its layer is locked) or a guid that is not in the project gets a failed execution result instead of being skipped silently, and does not stop the other elements from being deleted. With dryRun true nothing is deleted and no undo step is created: the response has dryRun set to true, and each element that passes the checks made before deleting gets wouldDelete, so a script can preview a deletion before making it.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to delete, of any database (the floor plan, a section, a worksheet, a layout, ...): each is deleted in the database that contains it, whichever window is the current one, and the current window stays. The zones among them are deleted before all the others, so an automatic zone deleted together with its bounding elements is gone before its boundary is. Deleting the boundary of an automatic zone without the zone itself can open Archicad's modal 'No closed polygon found around the clicked point' dialog, which blocks the command until someone clicks it in Archicad.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input element, in the order of the input. On a dry run an element that passes every check made before deleting (it exists, its layer is not locked, it is editable) gets wouldDelete; Archicad can still refuse an element that passes them.
delete_elements_dry_run ¶
delete_elements_dry_run(
elements: list[ElementIdArrayItem],
) -> DeleteElementsResult
Preview this command without applying its changes. Deletes elements, each in the database that contains it (the floor plan, a section, a worksheet, a layout, ...), whichever window is the current one; the current window stays. The zones of the call are deleted before all the other elements, so an automatic zone deleted together with its bounding walls is gone before its boundary is; deleting the boundary of an automatic zone without the zone itself can open Archicad's modal 'No closed polygon found' dialog, which blocks the command until someone clicks it in Archicad. Returns an execution result for each input element: an element that could not be deleted (for example because its layer is locked) or a guid that is not in the project gets a failed execution result instead of being skipped silently, and does not stop the other elements from being deleted. With dryRun true nothing is deleted and no undo step is created: the response has dryRun set to true, and each element that passes the checks made before deleting gets wouldDelete, so a script can preview a deletion before making it.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to delete, of any database (the floor plan, a section, a worksheet, a layout, ...): each is deleted in the database that contains it, whichever window is the current one, and the current window stays. The zones among them are deleted before all the others, so an automatic zone deleted together with its bounding elements is gone before its boundary is. Deleting the boundary of an automatic zone without the zone itself can open Archicad's modal 'No closed polygon found around the clicked point' dialog, which blocks the command until someone clicks it in Archicad.
Returns:
delete_selected_elements ¶
delete_selected_elements() -> SuccessfulExecutionResult
Deletes the currently selected elements in one undo step, the same as pressing the Delete key. With dryRun true nothing is deleted and no undo step is created: the response has dryRun set to true and lists the selected elements, with wouldDelete when there is at least one, or fails when one of them cannot be edited (Archicad then deletes none of them).
Returns:
delete_selected_elements_dry_run ¶
delete_selected_elements_dry_run() -> (
DeleteSelectedElementsResult
)
Preview this command without applying its changes. Deletes the currently selected elements in one undo step, the same as pressing the Delete key. With dryRun true nothing is deleted and no undo step is created: the response has dryRun set to true and lists the selected elements, with wouldDelete when there is at least one, or fails when one of them cannot be edited (Archicad then deletes none of them).
Returns:
delete_user_data_of_elements ¶
delete_user_data_of_elements(
elements: list[ElementIdArrayItem],
dry_run: None | bool = None,
) -> DeleteUserDataOfElementsResult
Deletes the user data this add-on stored on the given elements. Archicad keeps the user data of an element per add-on, so the data of other add-ons is left as it is. All deletions are one undo step. The output has one execution result per element, aligned with the input array of elements. With dryRun true nothing is deleted and no undo step is created: the response has dryRun set to true, and each element that exists gets wouldDelete.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
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:
deselect_all ¶
deselect_all() -> SuccessfulExecutionResult
distribute_elements ¶
distribute_elements(
elements: list[ElementIdArrayItem],
direction: Direction,
mode: Mode,
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Distributes 3 or more elements on the floor plan or in the current 2D view evenly along X (horizontal) or Y (vertical), with equal distances between the middles of their plan bounding boxes (centers) or equal space between the boxes (gaps), by moving them in one undo step. The elements are taken in the order of their middles along the direction, and the two outermost stay where they are. The bounding boxes are those Get2DBoundingBoxes returns. Supported types: Wall, Column, Beam, Slab, Roof, Shell, Morph, Mesh, Zone, Object, Lamp, Stair, Railing, CurtainWall, Line, PolyLine, Arc, Circle, Spline, Hatch, Text and Hotspot. An element of another type (doors, windows and openings, which only slide along their host, subelements, dimensions, labels, ...) or one that cannot be edited gets a failed execution result naming the reason, and the other elements are still distributed.
Parameters:
-
elements(list[ElementIdArrayItem]) –At least 3 elements to distribute: Wall, Column, Beam, Slab, Roof, Shell, Morph, Mesh, Zone, Object, Lamp, Stair, Railing, CurtainWall, Line, PolyLine, Arc, Circle, Spline, Hatch, Text or Hotspot, in the current database. Their order does not matter: they are distributed in the order of the middles of their plan bounding boxes along the direction.
-
direction(Direction) –horizontal distributes the elements along X, vertical along Y. They are not moved in the other direction.
-
mode(Mode) –centers makes the distances between the middles of the plan bounding boxes equal, gaps makes the empty space between neighbouring bounding boxes equal (the gap is negative, so the boxes overlap, when the elements are wider together than the space between the two outermost elements).
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
edit_hierarchical_element ¶
edit_hierarchical_element(
element_id: ElementId,
) -> SuccessfulExecutionResult
Opens the given hierarchical element (Curtain Wall, Stair, Railing, Beam or Column) in its hierarchical 3D editing mode, as the Edit button of the element does. Fails when Archicad is already in an editing mode. Limitation: while the editing mode is open, Archicad refuses every JSON command, this add-on's included, with error 4001 (ongoing user input), FinishHierarchicalEditing included, so the mode can only be left in Archicad, with the button of its edit mode palette (reported for Archicad 29). Requires Archicad 27 or later.
Parameters:
-
element_id(ElementId) –The hierarchical element (Curtain Wall, Stair, Railing, Beam or Column) to open in hierarchical editing mode.
Returns:
elevate_elements ¶
elevate_elements(
elements_with_elevations: list[ElementsWithElevation],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Moves elements vertically by a given offset in meters, like Edit > Move > Elevate. An element that cannot be edited (its layer is hidden or locked, it is locked, or it is not available in teamwork) gets a failed execution result naming the reason instead of being skipped silently.
Parameters:
-
elements_with_elevations(list[ElementsWithElevation]) –The elements with elevation offset pairs.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
filter_elements ¶
filter_elements(
elements: list[ElementIdArrayItem],
filters: None | list[ElementFilter] = None,
layer_indices: None | list[int] = None,
floor_indices: None | list[int] = None,
element_types: None | list[ElementType] = None,
*,
from_hotlink: None | bool = None,
hotlink_ids: None | list[ElementId] = None,
) -> list[ElementIdArrayItem]
Keeps the elements that match all the given criteria: Archicad's flag filters (filters), layer (layerIndices), home story (floorIndices), element type (elementTypes) and hotlink (fromHotlink, hotlinkIds). Within one criterion any of the listed values matches; an omitted criterion does not filter.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
filters(None | list[ElementFilter], default:None) –Optional. Archicad's own flag filters. An element is kept only when it fulfills all of them.
-
layer_indices(None | list[int], default:None) –Optional. An element is kept only when it is on one of these layers (the layerIndex field of GetDetailsOfElements).
-
floor_indices(None | list[int], default:None) –Optional. An element is kept only when its home story is one of these (the floorIndex field of GetDetailsOfElements).
-
element_types(None | list[ElementType], default:None) –Optional. An element is kept only when its type is one of these.
-
from_hotlink(None | bool, default:None) –Optional. true keeps only the elements that came in through a placed hotlink (they are read-only), false only the project's own elements.
-
hotlink_ids(None | list[ElementId], default:None) –Optional. An element is kept only when it came in through one of these placed hotlink instances (the hotlinkId field of GetDetailsOfElements, elements of type Hotlink).
Returns:
-
list[ElementIdArrayItem]–A list of elements.
finish_hierarchical_editing ¶
finish_hierarchical_editing(
accept: bool,
) -> SuccessfulExecutionResult
Finishes the current hierarchical editing mode (Curtain Wall, Stair, Railing, Beam or Column): accept true keeps the changes (OK), accept false discards them (Cancel). The accept parameter is required, so changes are never discarded silently. Fails when Archicad is not in such an editing mode. Limitation: while an editing mode is open, Archicad refuses JSON commands with error 4001 (ongoing user input) before they run, so this command cannot leave a mode opened by EditHierarchicalElement or in Archicad (reported for Archicad 29); leave it in Archicad instead. Requires Archicad 27 or later.
Parameters:
-
accept(bool) –True to accept the changes made in the hierarchical editing mode (OK), false to discard them (Cancel).
Returns:
get_2d_bounding_boxes ¶
get_2d_bounding_boxes(
elements: list[ElementIdArrayItem],
) -> list[BoundingBox2DArrayItem | ErrorItem]
Get the 2D bounding box of elements as Archicad draws them, in the coordinates of the database the element is in: the floor plan, a section, a worksheet, a layout or a master layout. Works for 2D elements (Line, PolyLine, Arc, Hatch, Text, Label, Dimension, Drawing ...) as well as for model elements; a Text's box covers its drawn lines, a Drawing's box its frame with the title. The current window does not need to show the element. The output is the array of the bounding boxes respective to the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[BoundingBox2DArrayItem | ErrorItem]–A list of 2D bounding boxes.
get_3d_bounding_boxes ¶
get_3d_bounding_boxes(
elements: list[ElementIdArrayItem],
) -> list[BoundingBox3DArrayItem | ErrorItem]
Get the 3D bounding box of elements. The bounding box is calculated from the global origin in the 3D view. The output is the array of the bounding boxes respective to the input array of elements. An element without 3D geometry of its own gets an error item instead of a bounding box. Walls, Slabs, Roofs, Zones and Stairs are measured on their 3D model, so the box of a Wall includes its connections to other walls. The current window does not need to show the element: it works with a layout or a section open as well.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[BoundingBox3DArrayItem | ErrorItem]–A list of 3D bounding boxes.
get_3d_geometry_of_elements ¶
get_3d_geometry_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementGeometry3D | ErrorItem]
Gets the 3D geometry of elements as the solid bodies of their 3D model: a vertex list in world coordinates and the planar faces (with their holes) referencing it, each face with its surface attribute when that is a project attribute. The bodies of the subelements of a Stair, Railing or Curtain Wall, and of the segments of a Column or Beam, are included. The output is aligned with the input array of elements. The 3D model of the elements is generated as needed, so many elements can take a while.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementGeometry3D | ErrorItem]–The 3D geometry of each element, aligned with the input: the solid bodies of its 3D model, or an error.
get_3d_model_counts ¶
get_3d_model_counts() -> list[ErrorItem | Model3DCount]
Gets the number of components of each type (bodies, polygons, polygon edges, edges, vertices, normal vectors, materials and lights) in the 3D model Archicad currently holds. Bodies, materials and lights are counted with ACAPI_ModelAccess_GetNum; the polygons, polygon edges, edges, vertices and normal vectors, which that function refuses to count, are summed over the bodies. A type that cannot be counted gets an error item. Available from Archicad 27.
Returns:
-
list[ErrorItem | Model3DCount]–The number of components of each type in the 3D model Archicad currently holds, one item per type, or an error for a type that could not be counted.
get_all_elements ¶
get_all_elements(
filters: None | list[ElementFilter] = None,
databases: None | list[DatabaseIdArrayItem] = None,
) -> ElementsWithExecutionResults
Returns the identifier of all elements on the plan. Use the optional filter parameter for filtering. Objects that belong to another element (zone stamps, the parts of stairs and railings) are left out unless the IncludeSubElemObjects filter is given. Without databases it lists the current database: in a section or elevation window the model elements that the window shows (and its own 2D elements); pass the floor plan's database (GetDatabases) to list every model element.
Parameters:
-
filters(None | list[ElementFilter], default:None) – -
databases(None | list[DatabaseIdArrayItem], default:None) –A list of Archicad databases.
Returns:
get_body_materials_of_elements ¶
get_body_materials_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementBodyMaterials | ErrorItem]
Gets the building material of each body of the 3D model of the given elements. The 3D model is generated with separate components in a temporary sight, so a composite structure has one body per skin and the 3D window is not changed. The output is aligned with the input array of elements. Available from Archicad 28.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementBodyMaterials | ErrorItem]–The bodies of each element, aligned with the input, or an error.
get_calculated_parameters_of_curtain_wall_sub_elements ¶
get_calculated_parameters_of_curtain_wall_sub_elements(
elements: list[ElementIdArrayItem],
) -> list[CalculatedParametersOfElements | ErrorItem]
Gets the GDL parameters (name, type, value) of the given Curtain Wall Frame, Panel, Junction and Accessory elements as Archicad calculated them for their place in the curtain wall. GetGDLParametersOfElements returns the parameters the sub-element was set up with instead.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[CalculatedParametersOfElements | ErrorItem]–The calculated parameters of each given element, in the order of the input, or an error for an element that is not a curtain wall frame, panel, junction or accessory.
get_category_values_of_defaults ¶
get_category_values_of_defaults(
element_types: list[ElementType],
categories: None | list[ElementCategoryType] = None,
) -> list[DefaultCategoryValues | ErrorItem]
Gets the category values (Structural Function, Position, Renovation Status ...) of the tool defaults of the given element types, the values new elements of the type get, optionally only for the given category types. A category the default has no value in is listed without categoryValueId; an element type without any of the requested categories gets an error item. The names are localized: use the type and the categoryValueId in scripts.
Parameters:
-
element_types(list[ElementType]) –The element types whose tool defaults (the settings new elements get) are read.
-
categories(None | list[ElementCategoryType], default:None) –The categories to read. Left out: every category of the project.
Returns:
-
list[DefaultCategoryValues | ErrorItem]–The category values of the tool defaults of each element type, in the order of the input. A category Archicad cannot read for the type is left out of its list; an invalid element type, or one with none of the requested categories, is represented by an error object.
get_category_values_of_elements ¶
get_category_values_of_elements(
elements: list[ElementIdArrayItem],
categories: None | list[ElementCategoryType] = None,
) -> list[ElementCategoryValues | ErrorItem]
Gets the category values (Structural Function, Position, Renovation Status ...) of the given elements, optionally only for the given category types. An element that has none of the requested categories (an annotation, for example) gets an error item. The names are localized: use the type and the categoryValueId in scripts.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
categories(None | list[ElementCategoryType], default:None) –The categories to read. Left out: every category the element has.
Returns:
-
list[ElementCategoryValues | ErrorItem]–The category values of each element, in the order of the input. A category the element does not have is left out of its list; an element that does not exist or has none of the requested categories (an annotation, for example) is represented by an error object.
get_collisions ¶
get_collisions(
elements_group_1: list[ElementIdArrayItem],
elements_group_2: list[ElementIdArrayItem],
settings: CollisionCheckSettings | None = None,
) -> list[Collision]
Detect collisions between the given two groups of elements.
Parameters:
-
elements_group_1(list[ElementIdArrayItem]) –A list of elements.
-
elements_group_2(list[ElementIdArrayItem]) –A list of elements.
-
settings(CollisionCheckSettings | None, default:None) –
Returns:
-
list[Collision]–
get_connected_elements ¶
get_connected_elements(
elements: list[ElementIdArrayItem],
connected_element_type: ElementType,
) -> ConnectedElementsWrapper
Gets the elements hosted by (connected to) the given owner elements, filtered to the given element type: for example the Windows or Doors of a Wall, the frames, panels, junctions and accessories of a Curtain Wall, the risers, treads and structures of a Stair, or the posts, rails and panels of a Railing.
Parameters:
-
elements(list[ElementIdArrayItem]) –The owner (host) elements whose connected elements are collected, e.g. Walls, Curtain Walls, Stairs or Railings.
-
connected_element_type(ElementType) –The type of the connected elements to collect, e.g. Window or Door for a Wall owner, or a subelement type of a Curtain Wall, Stair or Railing owner.
Returns:
get_curtain_wall_absolute_bottoms ¶
get_curtain_wall_absolute_bottoms(
elements: list[ElementIdArrayItem],
) -> list[CurtainWallAbsoluteBottom | ErrorItem]
Gets the absolute bottom level of curtain walls or their subelements (segments, frames, panels, junctions, accessories). The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[CurtainWallAbsoluteBottom | ErrorItem]–The absolute bottom of each element, aligned with the input, or an error.
get_cut_polygons_of_elements ¶
get_cut_polygons_of_elements(
elements: list[ElementIdArrayItem],
cut_plane: ElementCutPlane,
) -> list[ElementCutPolygons | ErrorItem]
Cuts each body of the 3D model of the given elements with a plane and returns, for each body, its building material, the area of the cut surface and its polygons (outline and holes) in 2D coordinates of the plane. From Archicad 28 the 3D model is generated with separate components in a temporary sight, so a composite structure has one body per skin and the 3D window is not changed. Before Archicad 28 the bodies are those of the element's 3D model (a composite structure is one body) and their building materials are left out. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
cut_plane(ElementCutPlane) –
Returns:
-
list[ElementCutPolygons | ErrorItem]–The cut of each body of each element, aligned with the input, or an error.
get_descriptors_of_elements ¶
get_descriptors_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementDescriptors | ErrorItem]
Gets the descriptors of the given elements: the listing descriptors in the property objects of each element, with the library part that declares them (index, name and guid), their listing database set and index, and their status (Normal, Deleted or Local). The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementDescriptors | ErrorItem]–The descriptors of each element, aligned with the input array of elements, or an error.
get_details_of_elements ¶
get_details_of_elements(
elements: None | list[ElementIdArrayItem] = None,
fields: None | list[ElementDetailsField] = None,
*,
filter: ElementTypeFloorLayerFilter | None = None,
additional_fields: None
| list[ElementDetailsAdditionalField] = None,
read_from_other_databases: None | bool = None,
) -> list[
DetailsOfElement
| ElementHeaderFromOtherDatabase
| ErrorItem
]
Gets the details of elements (geometry parameters etc). When elements is omitted, all elements matching the optional server-side filter (types, floorIndices, layerIndices) are queried; an empty elements list returns no details. Use the optional fields parameter to return only the fields you need (e.g. elementId, type, id, floorIndex) and skip the computation of the others (for example floorPlanPolygons). Use the optional additionalFields parameter to also get the info string, the compound info string, the library part unique ID and the creator tool unique ID. The components of a Railing (posts, inner posts, rails, top rails, handrails, balusters, baluster sets, panels, patterns, rail ends, rail connections and end finishes, as GetSubelementsOfHierarchicalElements lists them) return their owner, library part and settings. A Stair returns the structure settings of each part and side (structures, with the monolith or side stringer data of its type), and a StairStructure subelement returns the same keys. A Stair also returns its plan outline (its left and right boundary lines) and its walking lines. An element of another database (a layout, a section, a worksheet ...) returns only its header fields (type, floor index, layer, draw index) with fromOtherDatabase set to true, unless readFromOtherDatabases is true: then it is read in full in its own database, without opening a window. Archicad 29 already reads such elements in full without it. From Archicad 28 an MEP element returns the details the MEP commands give: a route (routing element), routing segment or routing node as GetMEPRoutingElements, any other MEP element (rigid segment, elbow, transition, terminal, ...) as GetMEPElementDetails; its type stays Unknown, and the MEP type is in GetMEPElements (and in the details of the elements GetMEPElementDetails reads).
Parameters:
-
elements(None | list[ElementIdArrayItem], default:None) –Optional list of elements to get details for. When omitted, all elements in the current database (optionally filtered by the filter parameter) are used; an empty list returns no details.
-
fields(None | list[ElementDetailsField], default:None) –Optional filter for the fields to return for each element. When omitted, every field is returned. Fields not listed are not computed at all, so listing only what you need skips in particular the floorPlanPolygons extraction, which regenerates each element's 2D drawing primitives and can dominate the execution time of batch reads.
-
filter(ElementTypeFloorLayerFilter | None, default:None) –Optional server-side filter. Without elements, only the elements matching it are returned. A listed element that does not match it gets an error entry in its place.
-
additional_fields(None | list[ElementDetailsAdditionalField], default:None) –Optional extra fields to return for each element, on top of the ones selected by fields. None of them is returned unless listed here, so callers that do not give this parameter get the same response as before.
-
read_from_other_databases(None | bool, default:None) –Optional, default false. When true, a listed element of another database (a drawing on a layout that is not open, an element of a worksheet, a section, a master layout ...) is read in full: the add-on makes the element's own database the current one while it reads it, without opening a window, and puts the starting database back afterwards. Without it, such an element returns only its header fields with fromOtherDatabase set to true. An element whose database cannot be made current (for example a worksheet whose window was never opened) still returns only its header. Archicad 29 already reads such elements in full without this key (seen on macOS), so it changes nothing there.
Returns:
-
list[DetailsOfElement | ElementHeaderFromOtherDatabase | ErrorItem]–One entry per input element, in the same order as the input elements array. An element that cannot be read, or that does not match the filter, gets an error entry in its place, so the position of an entry tells which input element it belongs to. Without elements, one entry per element that matches the filter.
get_dimension_data ¶
get_dimension_data(
elements: list[Element],
) -> list[DimensionData | ErrorItem]
Gets the data of existing dimension chains: the line pen, the marker type, pen and size, the text placement method and the default witness line, and per witness point the coordinates, measured value, witness line, the text height, pen, frame, font and style, and the text content (measured value or custom text), superscript and whether the text was moved by hand.
Parameters:
-
elements(list[Element]) –The identifier of the dimension elements.
Returns:
-
list[DimensionData | ErrorItem]–
get_drawing_primitives_of_elements ¶
get_drawing_primitives_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementDrawingPrimitives | ErrorItem]
Returns the 2D drawing primitives (points, lines, arcs, texts, polylines, triangles, polygons, pictures) Archicad draws each given floor plan element from, in drawing order, as ACAPI_DrawingPrimitive_ShapePrimsExt decomposes it on every story and unclipped. Control items (type Ctrl_*) mark the beginning and the end of sub-parts such as hatches and texts. Texts are returned with their content, the text as Archicad displays it (for example the lines of a zone stamp with their values filled in), which each element's texts list also collects in drawing order; polylines are returned without their vertices. A Ctrl_ElementRef item names the element it refers to: the drawing of a Wall ends with one for each Window and Door in it, while Windows and Doors give no primitives of their own. The floor plan must be the current database. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementDrawingPrimitives | ErrorItem]–The drawing primitives of each element, in the order of the input elements.
get_element_at_coordinate ¶
get_element_at_coordinate(
element_type: ElementType,
coordinate: Coordinate2D,
z: None | float = None,
filters: None | list[ElementFilter] = None,
) -> GetElementAtCoordinateResult
Finds the element of the given polygonal type (for example Slab, Roof, Mesh, Zone or Hatch) at a coordinate of the floor plan of the current database, the way a click there would. Use the optional filters parameter (the values of FilterElements) to consider only, for example, the elements visible by layer, and the optional z parameter to give the elevation of the point. Returns found: false when there is no such element. Useful together with GetPointFromUser.
Parameters:
-
element_type(ElementType) –The type of the element to look for. Only polygonal element types can be searched, for example Slab, Roof, Mesh, Zone or Hatch.
-
coordinate(Coordinate2D) –The point to search at, in the project's coordinates, on the floor plan of the current database.
-
z(None | float, default:None) –Optional. The elevation of the search point, handed to Archicad together with the coordinate. Archicad finds the highest element whose top is below z. Default is 0; without z a point 1 mm higher is also tried, so an element whose top is at 0 (for example a slab at the story level) is found, and then the topmost element on the active story, so an element whose top is above the story level is found too, like a click on the floor plan.
-
filters(None | list[ElementFilter], default:None) –Optional. Only an element passing every given filter is found (the same values as FilterElements accepts).
Returns:
get_element_categories ¶
get_element_categories() -> list[ElementCategoryDetails]
Lists the element categories of the project (Structural Function, Position, Renovation Status, Renovation Filter and, in the German version, BRI) with their possible values. The names of the categories and values are localized: identify a category by its type and a value by its categoryValueId, never by name.
Returns:
-
list[ElementCategoryDetails]–The element categories of the project, each with its possible values.
get_element_changes_since ¶
get_element_changes_since(
state_id: ElementStateId,
to_state_id: ElementStateId | None = None,
) -> GetElementChangesSinceResult
Returns the new, modified and deleted elements between a state captured by CaptureElementState and either another captured state (toStateId) or the current state of the project. Scripts that keep an external copy of the model use it to sync only what changed instead of re-reading every element. The changes come from Archicad's element difference generator, which tracks the model elements: 2D elements such as texts, labels and hatches can be missing from the lists, so read those directly. Fails for a stateId that is unknown - never captured, released, or lost because the project was closed or Archicad restarted.
Parameters:
-
state_id(ElementStateId) –The state to compare from, as returned by CaptureElementState.
-
to_state_id(ElementStateId | None, default:None) –The state to compare to, as returned by CaptureElementState with the same type as stateId. If omitted, the current state of the project is used, so the response lists what changed since stateId was captured.
Returns:
get_element_connections ¶
get_element_connections(
elements: list[ElementIdArrayItem],
) -> GetElementConnectionsResult
Gets the connections among the given elements: each pair of touching elements once, with the polygons of the surface where they touch, in world coordinates. The 3D model of the elements is generated with separate components in a temporary sight, so the 3D window is not changed. Also returns, aligned with the input array of elements, whether each element was found. Available from Archicad 28.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to search connections among. Only connections between two of these elements are returned.
Returns:
get_element_field_definitions ¶
get_element_field_definitions(
element_type: ElementType,
) -> GetElementFieldDefinitionsResult
Lists every field of an element type's struct in the Archicad API (e.g. API_AngleDimensionType) that GetElementFields reads and SetElementFields writes (and GetFieldsOfElementDefaults and SetFieldsOfElementDefaults in the tool defaults): its path, JSON type, C++ kind, size and whether it is read-only, with the reason. The list is generated from the Archicad 29 and 30 DevKit headers; other Archicad versions answer that it is not available.
Parameters:
-
element_type(ElementType) –The element type whose fields are listed.
Returns:
get_element_fields ¶
get_element_fields(
elements: list[ElementIdArrayItem],
fields: None | list[str] = None,
) -> list[ElementFieldValues | ErrorItem]
Reads fields of elements by their path in the element's struct in the Archicad API (e.g. note.noteFont of an angle dimension, u.planeRoof.angle of a roof): every field, or only the given ones. Reaches the settings the other commands do not return.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
fields(None | list[str], default:None) –The paths of the fields to read (see GetElementFieldDefinitions), e.g. ["note.noteFont", "note.frame"]. Every field of the element is read when it is left out. A path the element type does not have is listed in the element's missingFields.
Returns:
-
list[ElementFieldValues | ErrorItem]–The fields of each element, aligned with the input.
get_element_preview_image ¶
get_element_preview_image(
element_id: ElementId,
image_type: ImageType | None = None,
format: Format | None = None,
width: None | int = None,
height: None | int = None,
) -> str
Returns the preview image of the given element.
Parameters:
-
element_id(ElementId) – -
image_type(ImageType | None, default:None) –The type of the preview image. Default is 3D.
-
format(Format | None, default:None) –The image format. Default is png.
-
width(None | int, default:None) –The width of the preview image in pixels. Default is 128.
-
height(None | int, default:None) –The height of the preview image in pixels. Default is 128.
Returns:
-
str–The base64 encoded preview image.
get_element_type_names ¶
get_element_type_names(
element_types: list[ElementType],
) -> list[ElementTypeName | ErrorItem]
Gets the localized names of the given element types, as the running Archicad shows them (for example 'Wand' for Wall in German Archicad). The output is aligned with the input array of element types. Available from Archicad 27.
Parameters:
-
element_types(list[ElementType]) –The element types to get the localized names of.
Returns:
-
list[ElementTypeName | ErrorItem]–The localized name of each element type, aligned with the input, or an error.
get_elements_by_criteria ¶
get_elements_by_criteria(
types: None | list[ElementType] = None,
floor_indices: None | list[int] = None,
layer_indices: None | list[int] = None,
filters: None | list[ElementFilter] = None,
property_criteria: None
| list[PropertyCriterion] = None,
count_only: None | bool = None,
limit: None | int = None,
databases: None | list[DatabaseIdArrayItem] = None,
) -> GetElementsByCriteriaResult
Returns the elements, or with countOnly only their number, that match all the given criteria: element types, home stories, layers, Archicad's element filter flags and property criteria (a value compared in internal units, or a value status such as hasValue, isUserUndefined, isNotAvailable, isDefault or hasCustomValue). An unknown type, property or operator is an error, not ignored. Objects that belong to another element (zone stamps, the parts of stairs and railings) are left out unless the IncludeSubElemObjects filter is given. It searches the current database, as GetElementsByType does (in a section or elevation window the model elements the window shows), or the given databases.
Parameters:
-
types(None | list[ElementType], default:None) –Optional filter for element types (e.g. ['Wall', 'Column']).
-
floor_indices(None | list[int], default:None) –Optional filter for story/floor indices (e.g. [0, 1]).
-
layer_indices(None | list[int], default:None) –Optional filter for layer attribute indices.
-
filters(None | list[ElementFilter], default:None) –Optional Archicad API element filter flags. Objects that belong to another element (zone stamps, the parts of stairs, railings and curtain walls) are left out unless IncludeSubElemObjects is given, as in GetElementsByType and GetAllElements.
-
property_criteria(None | list[PropertyCriterion], default:None) –Optional list of property evaluation criteria. All criteria must match (AND condition).
-
count_only(None | bool, default:None) –If true, only returns the count of matching elements without listing their GUIDs. Minimizes token usage.
-
limit(None | int, default:None) –Maximum number of matching elements to list. The count is still the total number of matches.
-
databases(None | list[DatabaseIdArrayItem], default:None) –Optional. The databases to search, as GetDatabases lists them; an element found in more than one is counted once. If omitted, the current database is searched: the floor plan, or in a section or elevation window the model elements it shows.
Returns:
get_elements_by_type ¶
get_elements_by_type(
element_type: ElementType,
filters: None | list[ElementFilter] = None,
databases: None | list[DatabaseIdArrayItem] = None,
) -> ElementsWithExecutionResults
Returns the identifier of every element of the given type on the plan. It works for any type. Use the optional filter parameter for filtering. Objects that belong to another element (zone stamps, the parts of stairs and railings) are left out unless the IncludeSubElemObjects filter is given. Without databases it lists the current database: in a section or elevation window the model elements of the type that the window shows, the same elements GetAllElements reports there; pass the floor plan's database (GetDatabases) to list every one.
Parameters:
-
element_type(ElementType) – -
filters(None | list[ElementFilter], default:None) – -
databases(None | list[DatabaseIdArrayItem], default:None) –A list of Archicad databases.
Returns:
get_elements_in_creation_order ¶
get_elements_in_creation_order(
databases: None | list[DatabaseIdArrayItem] = None,
) -> ElementsWithExecutionResults
Returns the identifier of every element of the current database, or of the given databases, in the order the elements were created.
Parameters:
-
databases(None | list[DatabaseIdArrayItem], default:None) –A list of Archicad databases.
Returns:
get_elements_in_draw_order ¶
get_elements_in_draw_order(
element_type: ElementType | None = None,
filters: None | list[ElementFilter] = None,
databases: None | list[DatabaseIdArrayItem] = None,
) -> ElementsWithExecutionResults
Returns the identifier of every element of the current database, or of the given databases, in Archicad's drawing order (the order set by Bring to Front and Send to Back), as ACAPI_DrawOrder_DrawOrderGetNext walks it. Use the optional elementType and filters parameters for filtering. Objects that belong to another element (zone stamps, the parts of stairs and railings) are left out unless the IncludeSubElemObjects filter is given. Items of the drawing order whose element Archicad cannot read are left out too, so every returned identifier can be used with the other commands.
Parameters:
-
element_type(ElementType | None, default:None) –Optional. Only elements of this type are returned, still in drawing order. If omitted, every element is returned.
-
filters(None | list[ElementFilter], default:None) –Optional. The filters an element must pass to be returned, the same as for GetElementsByType.
-
databases(None | list[DatabaseIdArrayItem], default:None) –The databases to list the elements of, each in its own drawing order. If omitted, the current database is used.
Returns:
get_fields_of_element_defaults ¶
get_fields_of_element_defaults(
element_types: list[ElementType],
fields: None | list[str] = None,
) -> list[ErrorItem | ToolDefaultFieldValues]
Reads fields of the tool defaults of element types, the settings new elements of the type get, by their path in the element's struct in the Archicad API (see GetElementFieldDefinitions), e.g. thickness of the wall defaults: every field, or only the given ones. Reaches the default settings the other commands do not return. The list is generated from the Archicad 29 and 30 DevKit headers; other Archicad versions answer that it is not available.
Parameters:
-
element_types(list[ElementType]) –The element types whose tool defaults are read.
-
fields(None | list[str], default:None) –The paths of the fields to read (see GetElementFieldDefinitions), e.g. ["thickness", "height"]. Every field of the defaults is read when it is left out. A path the element type does not have is listed in missingFields.
Returns:
-
list[ErrorItem | ToolDefaultFieldValues]–The fields of the tool defaults of each element type, in the input order, or an error when the type has no fields in the table or no tool defaults.
get_gdl_parameters_of_elements ¶
get_gdl_parameters_of_elements(
elements: list[ElementIdArrayItem],
*,
parameter_names: None | list[str] = None,
include_possible_values: None | bool = None,
) -> list[GDLParameterList]
Gets all the GDL parameters (name, type, value) of the given elements. parameterNames returns only the named parameters, and includePossibleValues false leaves out the value lists (which for font parameters list every installed font), for a much smaller answer. For the railing components GetSubelementsOfHierarchicalElements lists (posts, rails, balusters, panels ...), which have no parameter session in the Archicad API, the parameters are read from the component itself: isLocked is then always false and possibleValues is not given.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
parameter_names(None | list[str], default:None) –Optional. Only the parameters with these GDL variable names are returned (case-insensitive), in the order of the library part. A name the element's library part does not have is left out. All parameters are returned when it is not given.
-
include_possible_values(None | bool, default:None) –Optional, true by default. When false, possibleValues (the value lists of the Parameter Script, e.g. every installed font for a font parameter) is left out of the answer, which makes it much smaller.
Returns:
-
list[GDLParameterList]–The GDL parameters of elements.
get_grid_element_defaults ¶
get_grid_element_defaults() -> GetGridElementDefaultsResult
Returns the Grid Tool defaults: library part, size and GDL parameters of a new grid element. Needs Archicad 26 or later.
Returns:
get_grid_elements ¶
get_grid_elements(
include_parameters: None | bool = None,
) -> list[GridElementDetails]
Lists the grid elements (placed with the Grid Tool or created by CreateGridElements) with their position, angle, size, library part and optionally GDL parameters. Needs Archicad 26 or later.
Parameters:
-
include_parameters(None | bool, default:None) –Also return the GDL parameters of each grid element. Default false.
Returns:
-
list[GridElementDetails]–
get_hierarchical_element_owners ¶
get_hierarchical_element_owners(
elements: list[ElementIdArrayItem],
owner_mode: HierarchicalOwnerMode | None = None,
) -> list[ErrorItem | HierarchicalElementOwner]
Gets the owner of each given element in its hierarchical element: the root (e.g. the Curtain Wall, Stair or Railing of a frame, tread or post) or the immediate parent. Also returns whether the given element is a main element, a subelement or not part of a hierarchical element.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements whose owners are looked up, e.g. Curtain Wall frames or panels, Stair treads or Railing posts.
-
owner_mode(HierarchicalOwnerMode | None, default:None) –root by default.
Returns:
-
list[ErrorItem | HierarchicalElementOwner]–The owner of each element, aligned with the input.
get_hotspots_of_elements ¶
get_hotspots_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementHotspots | ErrorItem]
Gets the 2D hotspots of the given library part instances (Objects, Lamps, Windows, Doors, Skylights, Zones, Curtain Wall parts, etc.), in the library part's own coordinate system. For their positions in the project use GetSnapPointsOfElements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementHotspots | ErrorItem]–The hotspots of the given library part instances, in the order of the input.
get_lib_part_transformations ¶
get_lib_part_transformations(
elements: list[ElementIdArrayItem],
) -> list[ElementLibraryPartTransformation | ErrorItem]
Gets the placement transformation of library part instances (Window, Door, Object, Lamp, Zone) as Archicad computes it: the location, the rotation angle and the x/y scaling. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementLibraryPartTransformation | ErrorItem]–The placement transformation of each element, aligned with the input, or an error.
get_linked_property_objects_of_elements ¶
get_linked_property_objects_of_elements(
elements: list[
ElementIdArrayItem | PropertyObjectToolDefault
],
) -> list[ElementLinkedPropertyObjects | ErrorItem]
Gets how property objects (the library parts of the old listing system) are linked to the given elements, or to the element defaults of the given element types: whether the property objects matching their criteria are linked, which of them match, and which one is assigned individually, each with the library part's index (the same as the index returned by GetAvailableLibraryParts), name and guid. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem | PropertyObjectToolDefault]) –A list of elements, or of element types to read the links of the element defaults of that type.
Returns:
-
list[ElementLinkedPropertyObjects | ErrorItem]–The property object links of each element or element default, aligned with the input array of elements, or an error.
get_links_of_elements ¶
get_links_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementLinks | ErrorItem]
Gets the links created by LinkElements that start from the given elements: the linked element and the flags of each link. Links pointing to an element are not returned; query the elements they start from. Returns an error item for an element that does not exist.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements whose outgoing links are returned.
Returns:
-
list[ElementLinks | ErrorItem]–The links starting from each element, aligned with the input.
get_marker_parameters_of_elements ¶
get_marker_parameters_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | MarkerParametersOfElement]
Gets the marker library part and the marker's GDL parameters (name, type, value) of the given Window, Door and Change Marker elements. The marker of an opening is the stamp drawn next to it on the floor plan; its parameters are separate from the opening's own GDL parameters, which GetGDLParametersOfElements returns. The marker of a Change Marker is its marker head, e.g. with the texts typed into it; a Change Marker with only a cloud has no marker and gets an error. GetDetailsOfElements gives the Change a Change Marker is linked to.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | MarkerParametersOfElement]–The marker of each given element, in the order of the input, or an error for an element that is not a window, a door or a change marker, or has no marker (a change marker with only a cloud).
get_marquee ¶
get_marquee() -> GetMarqueeResult
Gets the marquee of the current window: its shape (rectangle, rotated rectangle or polygon), whether it is multi-story, and its outline as a polygon. Returns the type 'none' when there is no marquee.
Returns:
-
GetMarqueeResult–
get_model_extent ¶
get_model_extent() -> BoundingBox3D
Returns the 3D extent (xMin, yMin, zMin, xMax, yMax, zMax) of the current database, the region Archicad's Fit in Window would show.
Returns:
-
BoundingBox3D–
get_opening_default ¶
get_opening_default() -> GetOpeningDefaultResult
Returns the settings of the Opening tool defaults: the extrusion parameters (as GetOpeningDetails returns them) and the floor plan parameters (as GetOpeningFloorPlanParameters returns them). Available from Archicad 29.
Returns:
get_opening_details ¶
get_opening_details(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | OpeningDetails]
Returns the details of Opening elements: whether they exist, the parent element, the cut and connected elements, the geometry (anchor point, extrusion direction, axes, polygon) and the extrusion parameters (constraint, limit type, linked status, shape type, size, anchor, offsets, surface overrides). Available from Archicad 29.
Parameters:
-
elements(list[ElementIdArrayItem]) –The Opening elements (made with the Opening tool) to read.
Returns:
-
list[ErrorItem | OpeningDetails]–The details of the openings, in the order of the given elements.
get_opening_floor_plan_parameters ¶
get_opening_floor_plan_parameters(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | OpeningFloorPlanDetails]
Returns the floor plan parameters of Opening elements: the floor plan display mode, the divided opening mode, the open edge style, the reference axis, the cut surface and outline lines, the cover fills and the cut and uncut symbols. Available from Archicad 29.
Parameters:
-
elements(list[ElementIdArrayItem]) –The Opening elements (made with the Opening tool) to read.
Returns:
-
list[ErrorItem | OpeningFloorPlanDetails]–The floor plan parameters of the openings, in the order of the given elements.
get_opening_symbol_parameters ¶
get_opening_symbol_parameters(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | OpeningSymbolParameters]
Returns the GDL parameters of the cut and uncut floor plan symbols of Opening elements, in the format of GetGDLParametersOfElements. A symbol the opening does not have is left out. Available from Archicad 29.
Parameters:
-
elements(list[ElementIdArrayItem]) –The Opening elements (made with the Opening tool) to read.
Returns:
-
list[ErrorItem | OpeningSymbolParameters]–The GDL parameters of the floor plan symbols of the openings, in the order of the given elements.
get_opening_transformations ¶
get_opening_transformations(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | OpeningTransformation]
Gets the placement of Opening elements, Windows, Doors and Skylights without changing them: a global-to-local transformation matrix, its inverse, and the origin and axes in world coordinates derived from the inverse. For Windows, Doors and Skylights the local- to-global matrix is the one Archicad returns, and mirrored ones give a left-handed matrix (isMirrored). For Opening elements it is built from the opening geometry (Archicad 29 and later): origin at the anchor point, the X and Y axes of the opening and Z = X × Y, which points against the extrusion direction. Needs Archicad 27 or later.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | OpeningTransformation]–The transformation of each given Opening, or an error, in the order of the input elements.
get_polygon_vertex_ids_of_elements ¶
get_polygon_vertex_ids_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementPolygonVertexIds | ErrorItem]
Gets the polygon vertices of the given elements that have a polygon with vertex IDs (Slabs, Zones, Roofs, Meshes, Fills and others): for each point of the outline and of each hole, in the order GetDetailsOfElements returns them, its coordinate, its index in the element's polygon (inIndex), the vertex ID Archicad stores for it and the edge ID of the edge that starts at it. These are the inIndex and nodeId a witness point of CreateAssociativeDimensions needs to attach to a vertex (vertexId) or an edge (edgeId) of the polygon; the IDs are kept when vertices are inserted or deleted, so they cannot be worked out from the order of the points. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementPolygonVertexIds | ErrorItem]–The polygon vertices of each element, aligned with the input array of elements, or an error for an element without a polygon that has vertex IDs.
get_profile_values_of_elements ¶
get_profile_values_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementProfileValues | ErrorItem]
Returns the custom profiles walls, beams and columns use, with the values the element gives them: the width and height of the stretched profile and the value of each profile modifier, measured on the stretched profile of the element, or on its original profile when Archicad returns the stretched one without modifiers (one per Profile wall, one per Profile segment of a beam or column). Read only: the Archicad API has no function that writes an element's modifier values or stretch.
Parameters:
-
elements(list[ElementIdArrayItem]) –
Returns:
-
list[ElementProfileValues | ErrorItem]–
get_property_objects_of_elements ¶
get_property_objects_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementPropertyObjects | ErrorItem]
Gets the property objects of the given elements: the library parts of the old listing system (used by projects migrated from older Archicad versions) linked to each element by criteria or individually, with the library part's index (the same as the index returned by GetAvailableLibraryParts), name and guid. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementPropertyObjects | ErrorItem]–The property objects of each element, aligned with the input array of elements, or an error.
get_quantities_of_elements ¶
get_quantities_of_elements(
elements: list[ElementIdArrayItem],
min_opening_size: None | float = None,
calculate_in_one_call: None | bool = None,
) -> list[ElementQuantityDetails | ErrorItem]
Gets the quantities of the given elements calculated by Archicad (volumes, surfaces, lengths etc.), together with the volume and projected area per building material (one item per skin of composite and complex profile elements, one item for basic elements). Supported types: Wall, Column, Beam, Slab, Roof, Shell, Morph, Zone, ColumnSegment, BeamSegment, Stair. Use the optional minOpeningSize parameter to control the conditional values, and calculateInOneCall to calculate the elements of each type in one Archicad call.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
min_opening_size(None | float, default:None) –Optional minimum opening size in square meters. Openings smaller than this are not subtracted from the conditional surfaces of a Wall (referenceSideSurfaceConditional and oppositeSideSurfaceConditional). Archicad only uses it for walls; the conditional volume follows the project's calculation rules instead. Default value is 0, so every opening is subtracted.
-
calculate_in_one_call(None | bool, default:None) –Optional. When true, Archicad calculates the quantities of all the supported elements of one type in one call (one call per element type, because Archicad only calculates elements of the same type together) instead of one call per element, which can be faster for many elements. The output has the same format. If the call of a type fails, every element of that type gets the same error. Default value is false.
Returns:
-
list[ElementQuantityDetails | ErrorItem]–The quantities of the elements, in the order of the given elements. Lengths are in meters, areas in square meters and volumes in cubic meters.
get_railing_segment_patterns ¶
get_railing_segment_patterns(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | RailingSegmentPatternsResult]
Gets the pattern of each segment of the given railings, telling the entry apart from its instances: the entry is the segment's pattern settings (distribution, panel, baluster set with its spacing, baluster and inner post) that Archicad generates the pattern from, the instances are the RailingPattern, RailingPanel, RailingBalusterSet and RailingInnerPost subelements it generated for the segment, whose own settings GetDetailsOfElements reads. Read only.
Parameters:
-
elements(list[ElementIdArrayItem]) –The railings to read.
Returns:
-
list[ErrorItem | RailingSegmentPatternsResult]–One item per given element, in the order of the input. An element that is not a railing, or whose segments cannot be read, is represented by an error object.
get_relations_of_elements ¶
get_relations_of_elements(
elements: list[ElementIdArrayItem],
other_element_type: ElementType | None = None,
) -> list[
BeamRelations
| BeamSegmentRelations
| ErrorItem
| OpeningRelationsOfElement
| RoofOrShellRelationsOfElement
| WallRelations
| ZoneRelationsOfElement
]
Gets the type-specific relations of the given elements: endpoint and reference line connections of walls, beams and beam segments, boundary elements and boundary sections of zones, the zones on the two sides of windows, doors, skylights and curtain wall panels, and the zones connected to roofs and shells. Available from Archicad 26.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
other_element_type(ElementType | None, default:None) –Optional filter: only relations to elements of this type are returned.
Returns:
-
list[BeamRelations | BeamSegmentRelations | ErrorItem | OpeningRelationsOfElement | RoofOrShellRelationsOfElement | WallRelations | ZoneRelationsOfElement]–Type- specific relations of each element, aligned with the input.
get_roof_planes ¶
get_roof_planes(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | RoofPlanesOfElements]
Gets the single planes of roofs, without changing the roofs. A multi-plane roof is decomposed by Archicad into its planes, each returned with its part identifier and its details as a single-plane roof (slope, pivot line, level, outline with arcs and holes); a single-plane roof is returned as its only plane. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | RoofPlanesOfElements]–The planes of each roof, aligned with the input, or an error.
get_room_image ¶
get_room_image(
zone_id: ElementId,
format: Format | None = None,
width: None | int = None,
height: None | int = None,
offset: None | float = None,
scale: None | float = None,
background_color: ColorRGB | None = None,
) -> str
Returns the room image of the given zone.
Parameters:
-
zone_id(ElementId) – -
format(Format | None, default:None) –The image format. Default is png.
-
width(None | int, default:None) –The width of the preview image in pixels. Default is 256.
-
height(None | int, default:None) –The height of the preview image in pixels. Default is 256.
-
offset(None | float, default:None) –Offset of the clip polygon from the edge of the zone. Default is 0.001.
-
scale(None | float, default:None) –Scale of the view (e.g. 0.005 for 1:200). Default is 0.005.
-
background_color(ColorRGB | None, default:None) –Background color of the generated image. Default is white (1.0, 1.0, 1.0).
Returns:
-
str–The base64 encoded room image.
get_section_elements ¶
get_section_elements(
databases: None | list[DatabaseIdArrayItem] = None,
) -> GetSectionElementsResult
Gets the elements drawn in the given section, elevation or interior elevation databases, each with the owner element it was generated from. This is the only command that returns raw section element identifiers - every other listing command converts them to their owner - so it is the way to obtain the sectionElementId that CreateAssociativeDimensionsOnSection requires.
Parameters:
-
databases(None | list[DatabaseIdArrayItem], default:None) –The section, elevation or interior elevation databases to list the section elements of. If omitted, the current database is used.
Returns:
get_selected_elements ¶
get_selected_elements() -> list[ElementIdArrayItem]
Gets the list of the currently selected elements.
Returns:
-
list[ElementIdArrayItem]–A list of elements.
get_shape_primitives_of_elements ¶
get_shape_primitives_of_elements(
elements: list[ElementIdArrayItem],
include_markers: None | bool = None,
) -> list[ElementDrawingPrimitives | ErrorItem]
Returns the 2D drawing primitives of each given floor plan element in the same format as GetDrawingPrimitivesOfElements, but drawn as ACAPI_DrawingPrimitive_ShapePrims draws it by default (on the current story, clipped as Archicad clips it) instead of on every story and unclipped. With includeMarkers the objects attached to the elements (window and door markers, drawing titles, ...) are drawn with them or left out; Archicad's setting is changed back afterwards. An element on another story gets an error item. The floor plan must be the current database. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
include_markers(None | bool, default:None) –Whether the objects attached to the elements (window and door markers, drawing titles, ...) are drawn with them. When omitted, Archicad's current setting is used. The setting is changed back after the drawing.
Returns:
-
list[ElementDrawingPrimitives | ErrorItem]–The drawing primitives of each element, in the order of the input elements.
get_skylight_hole_polygons ¶
get_skylight_hole_polygons(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | SkylightHolePolygon]
Gets the polygon of the hole each given Skylight cuts into its host Roof or Shell: the outline and any holes of it as 2D coordinates. The output is aligned with the input array of elements; an element that is not a Skylight gets an error item.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | SkylightHolePolygon]–The hole each Skylight cuts into its host Roof or Shell, aligned with the input: its polygon, or an error (for example for an element that is not a Skylight).
get_snap_points_of_elements ¶
get_snap_points_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | SnapPointsOfElements]
Gets the snap points (hotspots) of the given elements, of any element type: the points of an element that the cursor snaps to and dimensions attach to (for example the endpoints of a Wall's reference line or the vertices of a Slab), in world coordinates, each with the neig kind and subindex identifying which point of the element it is. For the 2D hotspots of library part instances see GetHotspotsOfElements. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | SnapPointsOfElements]–The snap points (hotspots) of each element, aligned with the input array of elements, or an error.
get_spline_max_distances ¶
get_spline_max_distances(
splines: list[SplineDistanceInput],
) -> list[ErrorItem | SplineMaxDistance]
Measures how far the given 2D coordinates are from a segment of a Spline element, between two of its fit points, with its own Bezier handles: returns the largest distance, for example to check how well a polyline follows the spline. The output is aligned with the input array. Changes nothing in the project.
Parameters:
-
splines(list[SplineDistanceInput]) –The spline segments to measure and the coordinates to measure from them.
Returns:
-
list[ErrorItem | SplineMaxDistance]–The result of each input item, in the same order, or an error.
get_story_control_primitives ¶
get_story_control_primitives(
database_id: DatabaseId,
) -> list[DrawingPrimitive]
Returns the 2D drawing primitives of the story levels (story lines and their markers) drawn in the given section, elevation or interior elevation database, as ACAPI_DrawingPrimitive_DrawStoryControl draws them, in the same format as GetDrawingPrimitivesOfElements. The databaseId can be obtained with GetDatabaseIdFromNavigatorItemId.
Parameters:
-
database_id(DatabaseId) –A section, elevation or interior elevation database, for example as GetDatabaseIdFromNavigatorItemId returns it.
Returns:
-
list[DrawingPrimitive]–The primitives of the story levels drawn in the database, in the order Archicad draws them. The Ctrl_* items mark the beginning and the end of sub-parts (texts, ...).
get_subelements_of_hierarchical_elements ¶
get_subelements_of_hierarchical_elements(
elements: list[ElementIdArrayItem],
) -> list[Subelement]
Gets the subelements of the given hierarchical elements. From Archicad 28 the subelements of external hierarchical elements (for example MEP elements or elements of other add-ons) are returned as externalSubelements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[Subelement]–
get_surface_quantities_of_elements ¶
get_surface_quantities_of_elements(
elements: list[ElementIdArrayItem],
cover_elements: None | list[ElementIdArrayItem] = None,
) -> list[ElementSurfaceQuantities | ErrorItem]
Gets the exposed surface areas of the given elements calculated by Archicad: for each element one item per surface attribute and building material pair with the area that is not covered by the covering elements (for example the wall area behind a slab is taken off the wall's surface). The covering elements are the optional coverElements; by default every construction element of the project. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to get the surface quantities of.
-
cover_elements(None | list[ElementIdArrayItem], default:None) –Optional covering elements: the area where one of them overlaps a surface of an element is subtracted from that surface, so for example a slab on a wall takes its footprint off the top surface of the wall. When omitted, every Wall, Column, Beam, Slab, Roof, Shell, Morph, Mesh, Stair and Curtain Wall of the project is a covering element. Pass an empty array to get the whole surfaces with nothing subtracted. An element never covers itself.
Returns:
-
list[ElementSurfaceQuantities | ErrorItem]–The surface quantities of the elements, in the order of the given elements. Areas are in square meters.
get_surface_types_of_elements ¶
get_surface_types_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementSurfaceTypes | ErrorItem]
Gets the surface type of every polygon of the 3D model of the given elements, as ACAPI_Polygon_PolygonId2SurfaceType returns it: for each element its polygons with their body index, polygon index, polygon id and the numeric API_SurfaceTypeID value. The model is generated with separate components in a temporary sight, so the 3D window is not changed. The output is aligned with the input array of elements. Available from Archicad 28.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementSurfaceTypes | ErrorItem]–The polygons of the 3D model of each element with their surface types, aligned with the input, or an error.
get_texture_coordinates ¶
get_texture_coordinates(
elements: list[ElementIdArrayItem],
) -> list[ElementTextureCoordinates | ErrorItem]
Gets the texture coordinates (u, v) of the faces of the 3D model of the given elements: per solid body, per face, at the first vertex of the face. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementTextureCoordinates | ErrorItem]–The texture coordinates of each element, aligned with the input: per solid body of its 3D model, or an error.
get_url_references_of_elements ¶
get_url_references_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ElementURLReference | ErrorItem]
Gets the web link (URL reference) of the given elements: a URL with a description, shown in Archicad in the element's settings under Element Information > Link. An element without a link gets the error APIERR_NOUSERDATA.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementURLReference | ErrorItem]–The web link of each given element, or an error. An element without a link gets the error APIERR_NOUSERDATA.
get_visible_skin_status ¶
get_visible_skin_status(
elements: list[ElementIdArrayItem],
structure_display: PartialStructureDisplay,
) -> list[ErrorItem | VisibleSkinStatus]
Checks whether elements have a visible skin in a given Partial Structure Display mode (EntireStructure, CoreOnly, WithoutFinishes or StructureOnly), e.g. a finish-only slab has none in CoreOnly. The current window is not changed. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
structure_display(PartialStructureDisplay) –The Partial Structure Display mode to check the elements in. The current window is not changed.
Returns:
-
list[ErrorItem | VisibleSkinStatus]–Whether each element has a visible skin in the given Partial Structure Display mode, aligned with the input, or an error.
get_zone_boundaries ¶
get_zone_boundaries(
zone_element_id: ElementId | None = None,
zones: None | list[ElementIdArrayItem] = None,
) -> ZoneBoundariesOfZonesWrapper | ZoneBoundariesWrapper
Gets the boundaries of the given Zones (connected elements, neighbour zones, etc.). Accepts either a single zoneElementId or a list of zones. Prefer the list: the expensive boundary recalculation runs once per call, so querying many Zones in one call is much faster than calling the command once per Zone.
Parameters:
-
zone_element_id(ElementId | None, default:None) –The identifier of a single Zone. Prefer the zones array: querying many Zones in one call is much faster than one call per Zone.
-
zones(None | list[ElementIdArrayItem], default:None) –A list of Zones. Only one of zoneElementId and zones can be given.
Returns:
get_zone_labeling_settings ¶
get_zone_labeling_settings() -> (
GetZoneLabelingSettingsResult
)
Returns whether the automatic labeling of Zones is on and the name of the Label Favorite it places. Available from Archicad 28.
Returns:
get_zone_reductions ¶
get_zone_reductions(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | ZoneReductions]
Gets the area reductions of the given Zones, as the Zone Stamp's area calculation uses them: the polygons of the Zone covered by Walls, Columns, reducing Fills, sloping Roofs and low ceilings, each with its type, the percentage it is reduced by, its area and its outline with holes. Area calculations by local standards need these parts, which GetQuantitiesOfElements only gives as totals. The output is aligned with the input array of elements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of Zones.
Returns:
-
list[ErrorItem | ZoneReductions]–The area reductions of each Zone, aligned with the input array of elements, or an error.
get_zone_stamp_of_defaults ¶
get_zone_stamp_of_defaults() -> (
GetZoneStampOfDefaultsResult
)
Returns the zone stamp of the Zone tool defaults, which every new Zone starts from: its library part index, name and main guid, and whether it is missing from the loaded libraries, together with the Zone Category of the defaults and that category's own zone stamp. A project from a template of an older Archicad can carry a default zone stamp that is not loaded; Archicad then refuses every CreateZones call, which SetZoneStampOfDefaults fixes.
Returns:
highlight_elements ¶
highlight_elements(
elements: list[ElementIdArrayItem],
highlighted_colors: list[list[int]],
wireframe_3d: None | bool = None,
non_highlighted_color: None | list[int] = None,
) -> SuccessfulExecutionResult
Highlights the elements given in the elements array. In case of empty elements array removes all previously set highlights. On Archicad 25 nonHighlightedColor is ignored.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
highlighted_colors(list[list[int]]) –A list of colors to highlight elements.
-
wireframe_3d(None | bool, default:None) –Optional parameter. Switch non highlighted elements in the 3D window to wireframe.
-
non_highlighted_color(None | list[int], default:None) –Optional parameter. Color of the non highlighted elements as an [r, g, b, a] array. Each component must be in the 0-255 range. Ignored on Archicad 25.
Returns:
link_elements ¶
link_elements(
links: list[ElementLinkData],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Creates persistent links between pairs of elements, each from one element to another, with an optional integer flags value per link. Scripts can record their own relations between elements this way (for example which label documents which column) instead of storing GUIDs in properties. The links are stored in the project and have no effect on geometry; they are independent from groups, hotlinks and solid element operations. A link is directional: it is returned by GetLinksOfElements for the element it starts from only, and removed by UnlinkElements. Undoable.
Parameters:
-
links(list[ElementLinkData]) –The links to create, each from one element to another.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result per link, aligned with the input.
lock_elements ¶
lock_elements(
elements: list[ElementIdArrayItem],
) -> SuccessfulExecutionResult
Locks the given elements. Manual lock, not teamwork!
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
measure_texts ¶
measure_texts(
texts: list[TextMeasurementData],
) -> list[ErrorItem | TextMeasurement]
Measures texts before placing them: the length of every line for a given font, style and height, on paper in millimetres or in the model at the current drawing scale, and the font's capital size factor. Creates nothing.
Parameters:
-
texts(list[TextMeasurementData]) –The texts to measure, each with the font, style and height it would be placed with. Nothing is created.
Returns:
-
list[ErrorItem | TextMeasurement]–One item per input text, in the same order. The measurement takes no width factor or character spacing into account.
mirror_elements ¶
mirror_elements(
elements_with_mirror_axes: list[ElementMirrorData],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Mirrors elements across an axis given by two points on the floor plan, optionally as a copy. An element that cannot be edited (its layer is hidden or locked, it is locked, or it is not available in teamwork) gets a failed execution result naming the reason instead of being skipped silently.
Parameters:
-
elements_with_mirror_axes(list[ElementMirrorData]) –The elements with mirror axes.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
move_elements ¶
move_elements(
elements_with_move_vectors: list[
ElementsWithMoveVector
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Moves elements with a given vector. An element that cannot be edited (its layer is hidden or locked, it is locked, or it is not available in teamwork) gets a failed execution result naming the reason instead of being skipped silently.
Parameters:
-
elements_with_move_vectors(list[ElementsWithMoveVector]) –The elements with move vector pairs.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
place_openings ¶
place_openings(
openings_data: list[OpeningPlacementData],
) -> list[ElementIdArrayItem | ErrorItem]
Places openings with the Opening tool settings at points of their parent elements. A point off the parent element's surface is moved to the closest point of the surface. Each opening can be given its own extrusion and floor plan settings, which change only that opening and not the tool's settings. Available from Archicad 29.
Parameters:
-
openings_data(list[OpeningPlacementData]) –
Returns:
-
list[ElementIdArrayItem | ErrorItem]–A list of element identifiers or errors.
recreate_angle_dimensions ¶
recreate_angle_dimensions(
angle_dimensions: list[AngleDimensionRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Angle Dimension elements on new lines with a new arc position (firstLine, secondLine and arcPosition, as CreateAngleDimensions takes them), because Archicad does not move the lines or the arc of an angle dimension through ACAPI_Element_Change (seen in Archicad 29). The new angle dimension is static, as CreateAngleDimensions creates it, and is created in the current database, where the old one has to be. It gets the old one's settings (pen, inner or outer arc, markers, witness lines, text pen, size, font, style, position and direction, custom text and the rest of API_AngleDimensionType), layer, story and renovation status, and its classifications, element categories and property values, and its Element ID where Archicad gives angle dimensions one (Archicad 29 refuses an Element ID on them, so there is none to carry); the text goes back to its automatic place on the new arc. The old angle dimension is then deleted. Each angle dimension is recreated in its own undo step, and when any step fails nothing is changed for it. The new angle dimension has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (the group it was in).
Parameters:
-
angle_dimensions(list[AngleDimensionRecreationData]) –The angle dimensions to recreate on new lines, with a new arc position.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input angle dimension: the new angle dimension, or an error. After an error nothing was changed for that angle dimension. The old one leaves its group.
recreate_curtain_walls ¶
recreate_curtain_walls(
curtain_walls: list[CurtainWallRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Curtain Wall elements on a new reference line with more or fewer segments, as CreateCurtainWalls takes it, because ModifyCurtainWalls can only keep the number of segments; or with a new height or slant angle, which Archicad does not apply to an existing slanted curtain wall through ACAPI_Element_Change (seen in Archicad 29). Without coordinates the old reference line is kept. The new curtain wall is created with the old one as templateElementId, so it gets its frame and panel classes, pattern, surfaces, boundary and corner frames, height, home story and base, layer and slant angle, unless height or angle is given; it also gets its Element ID, renovation status, classifications, element categories, property values, solid element operations and trims, and the old curtain wall is then deleted. Each curtain wall is recreated in its own undo step, and when any step fails nothing is changed for that curtain wall. The result lists what could not be carried over (labels, dimensions, group). Frames and panels changed one by one on the old curtain wall are generated again from its classes and pattern, as when it is drawn again in Archicad.
Parameters:
-
curtain_walls(list[CurtainWallRecreationData]) –The curtain walls to recreate on a new reference line, with a new height or with a new slant. Give at least one of coordinates, height and angle.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input curtain wall: the new curtain wall, or an error. After an error nothing was changed for that curtain wall. Its labels are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group.
recreate_doors ¶
recreate_doors(
doors: list[DoorRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Door elements in another wall (ownerWallId, optionally at a new centerOffset along it), because Archicad does not move a door into another wall through ACAPI_Element_Change: it keeps its owner (seen in Archicad 29). The new door is created as CreateDoors creates one, from the Door tool defaults with the tool's marker, with the old door's settings (size, sill, anchor, reveal, sides, pens, line types, surfaces and the rest of API_DoorType), library part and GDL parameters, layer and renovation status; its marker gets the old marker's parameters when both are of the same marker library part. It also gets the old door's Element ID, classifications, element categories and property values, and the old door is then deleted. Each door is recreated in its own undo step, and when any step fails nothing is changed for that door. The new door has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (labels, dimensions of the current database that measured the old door, group).
Parameters:
-
doors(list[DoorRecreationData]) –The doors to recreate in another wall.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input door: the new door, or an error. After an error nothing was changed for that door. Labels of the old door are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group.
recreate_railings ¶
recreate_railings(
railings: list[RailingRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Railing elements on a new reference line - with more or fewer nodes and segments, in 2D as CreateRailings takes it or with an elevation per node and arcs as CreateRailingsFromPolyline takes it - because the Archicad API cannot change the reference line of an existing railing. The new railing is created with the old one as templateElementId, so it gets its node and segment settings, posts, rails, handrails, toprails, panels and balusters, story visibility, pens, layer, home story and bottom offset; it also gets its Element ID, renovation status, classifications, element categories, property values, solid element operations and trims, and the old railing is then deleted. Each railing is recreated in its own undo step, and when any step fails nothing is changed for that railing. The result lists what could not be carried over (labels, dimensions, group). Settings given to single segments, nodes or posts of the old railing are not carried over: the new ones are generated from the railing's defaults, as when it is drawn again in Archicad.
Parameters:
-
railings(list[RailingRecreationData]) –The railings to recreate on a new reference line.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input railing: the new railing, or an error. After an error nothing was changed for that railing. Its labels are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group. The link of a railing to the slab or stair it was placed on cannot be read through the Archicad API, so it is not listed in notCarriedOver: the new railing has none.
recreate_skylights ¶
recreate_skylights(
skylights: list[SkylightRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Skylight elements on another roof or shell (ownerId, optionally at a new anchorPosition on it), because Archicad does not move a skylight onto another roof or shell through ACAPI_Element_Change: it keeps its owner (seen in Archicad 29). The new skylight is created as CreateSkylights creates one, from the Skylight tool defaults, with the old skylight's settings (size, anchor point, fix mode, azimuth, pens, line types, surfaces and the rest of API_SkylightType), library part and GDL parameters, layer and renovation status; Archicad sets its plane, level and elevation angle from the new owner. It also gets the old skylight's Element ID, classifications, element categories and property values, and the old skylight is then deleted. Each skylight is recreated in its own undo step, and when any step fails nothing is changed for that skylight. The new skylight has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (labels, dimensions of the current database that measured the old skylight, group).
Parameters:
-
skylights(list[SkylightRecreationData]) –The skylights to recreate on another roof or shell.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input skylight: the new skylight, or an error. After an error nothing was changed for that skylight. Labels of the old skylight are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group.
recreate_stairs ¶
recreate_stairs(
stairs: list[StairRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Stair elements on a new baseline (with its landings, winders and curved edges, as CreateStairs takes it), because the Archicad API cannot change the baseline of an existing stair. The new stair gets the old one's settings (everything ModifyStairs writes, its baseline position, rules and top link), Element ID, layer, home story and base offset, renovation status, classifications, element categories and property values, and its solid element operations (on Archicad 27 without their link flags, which the API cannot read there) and roof or shell trims; the old stair is then deleted. Each stair is recreated in its own undo step, and when any step fails nothing is changed for that stair. The new stair has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (associative labels, dimensions of the current database that measured the old stair, and the group it was in). Archicad lays out the boundaries and the walking lines of the new stair again from its baseline and flight width, so boundaries or a walking line edited by hand on the old stair are not carried over; the API cannot write them, so an item that gives one is refused and the stair is left as it was.
Parameters:
-
stairs(list[StairRecreationData]) –The stairs to recreate on a new baseline.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input stair: the new stair, or an error. After an error nothing was changed for that stair. Labels of the old stair are deleted with it; dimensions measuring it lose those witness points or are deleted.
recreate_windows ¶
recreate_windows(
windows: list[WindowRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates Window elements in another wall (ownerWallId, optionally at a new centerOffset along it), because Archicad does not move a window into another wall through ACAPI_Element_Change: it keeps its owner (seen in Archicad 29). The new window is created as CreateWindows creates one, from the Window tool defaults with the tool's marker, with the old window's settings (size, sill, anchor, reveal, sides, pens, line types, surfaces and the rest of API_WindowType), library part and GDL parameters, layer and renovation status; its marker gets the old marker's parameters when both are of the same marker library part. It also gets the old window's Element ID, classifications, element categories and property values, and the old window is then deleted. Each window is recreated in its own undo step, and when any step fails nothing is changed for that window. The new window has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (labels, dimensions of the current database that measured the old window, group).
Parameters:
-
windows(list[WindowRecreationData]) –The windows to recreate in another wall.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input window: the new window, or an error. After an error nothing was changed for that window. Labels of the old window are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group.
recreate_zones ¶
recreate_zones(
zones: list[ZoneRecreationData],
) -> list[ErrorItem | RecreatedElement]
Recreates automatic Zone elements as manual zones (makeManual), because Archicad does not turn an automatic zone into a manual one through ACAPI_Element_Change (seen in Archicad 29). The new manual zone has the polygon the old zone has now (with its arcs and holes, as GetDetailsOfElements returns it), so it no longer follows its boundaries when the zones are updated; it gets the old zone's category, name, number, stamp library part, stamp position and stamp parameters, levels, contour, cover fill, surface and the rest of API_ZoneType, layer and renovation status, and its Element ID, classifications, element categories and property values. The old zone is deleted first, since a new zone with its polygon would overlap it; a new zone that would overlap another zone of the story is refused, as CreateZones refuses it, unless allowOverlap is true. Each zone is recreated in its own undo step, and when any step fails nothing is changed for that zone. The new zone has a new GUID: the result maps the old GUID to the new one and lists what could not be carried over (labels, dimensions of the current database that measured the old zone, group).
Parameters:
-
zones(list[ZoneRecreationData]) –The zones to recreate as manual zones.
Returns:
-
list[ErrorItem | RecreatedElement]–One item per input zone: the new manual zone, or an error. After an error nothing was changed for that zone. Labels of the old zone are deleted with it, dimensions measuring it lose those witness points or are deleted, and it leaves its group.
refresh_elements ¶
refresh_elements(
elements: list[ElementIdArrayItem],
force: None | bool = None,
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Refreshes (rebuilds) the given elements, for example placed Objects, Windows and Doors that still show the old geometry after their library part's script or embedded file changed. Set force to true to run the parameter script of GDL-based elements too. The elements are looked up in the current database (floor plan, section or detail window). Returns an execution result for each input element. The refresh cannot be undone.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
force(None | bool, default:None) –Forces the rebuild of GDL-based elements, which runs their parameter script. The default is false.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
regularize_polygons ¶
regularize_polygons(
polygons: list[PolygonRegularizationData],
with_ancestry: None | bool = None,
) -> list[ErrorItem | RegularizedPolygons]
Regularizes polygons with Archicad's own polygon regularization, before they are used to create slabs, zones or fills: removes duplicate points, fixes the orientation, resolves self-intersections and touching holes. Each input polygon gives 0, 1 or more valid polygons in the format of CreateSlabs, optionally with the input vertex and edge each result vertex and edge came from. Changes nothing in the project.
Parameters:
-
polygons(list[PolygonRegularizationData]) –The polygons to regularize, in the format of CreateSlabs (polygonCoordinates, polygonArcs, holes). For CreateHatches, pass the outline of a result as its coordinates and arcs.
-
with_ancestry(None | bool, default:None) –Also return for every vertex and edge of the results which input vertex or edge it came from. Optional, false by default.
Returns:
-
list[ErrorItem | RegularizedPolygons]–One item per input polygon, in the order of the request.
regularize_polylines ¶
regularize_polylines(
polylines: list[PolylineRegularizationData],
with_ancestry: None | bool = None,
) -> list[ErrorItem | RegularizedPolyline]
Regularizes polylines with Archicad's own polyline regularization: removes repeated consecutive points. The result is in the format of CreatePolylines and may be empty, optionally with the input point and segment each result point and segment came from. Changes nothing in the project.
Parameters:
-
polylines(list[PolylineRegularizationData]) –The polylines to regularize, in the format of CreatePolylines.
-
with_ancestry(None | bool, default:None) –Also return for every point and segment of the results which input point or segment it came from. Optional, false by default.
Returns:
-
list[ErrorItem | RegularizedPolyline]–One item per input polyline, in the order of the request.
release_element_state ¶
release_element_state(
state_id: ElementStateId,
) -> SuccessfulExecutionResult
Frees a state captured by CaptureElementState. Every state is freed anyway when the project is closed or Archicad quits.
Parameters:
-
state_id(ElementStateId) –The state to free, as returned by CaptureElementState.
Returns:
remove_element_notification_client ¶
remove_element_notification_client(
port: int, host: None | str = None
) -> SuccessfulExecutionResult
Removes an element notification client.
Parameters:
-
port(int) –The port number of the notification client.
-
host(None | str, default:None) –The host address of the notification client. If not provided, localhost is used.
Returns:
rotate_copy_elements ¶
rotate_copy_elements(
elements: list[ElementIdArrayItem],
center: Coordinate2D,
angle: float,
count: None | int = None,
) -> list[Copy]
Copies elements rotated around a center on the floor plan by an angle in radians, like rotating a copy in Archicad, keeping all their settings. With count, copy n is rotated by n times the angle, which makes a circular array. Returns the new elements of each given element, in the order of the given ones; an element Archicad cannot copy gets an error naming the reason, and the other elements are still copied. All copies are one undo step.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to copy.
-
center(Coordinate2D) –The center of the rotation on the floor plan.
-
angle(float) –The angle in radians the first copy is rotated by from its element, counterclockwise.
-
count(None | int, default:None) –Optional number of copies of each element. Copy n is rotated by n times the angle, so more than one makes a circular array. By default it's 1.
Returns:
-
list[Copy]–One item for each given element, in the same order.
rotate_elements ¶
rotate_elements(
elements_with_rotations: list[ElementsWithRotation],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Rotates elements around a reference point. An element that cannot be edited (its layer is hidden or locked, it is locked, or it is not available in teamwork) gets a failed execution result naming the reason instead of being skipped silently.
Parameters:
-
elements_with_rotations(list[ElementsWithRotation]) –The elements with rotation settings.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
run_parameter_script_of_elements ¶
run_parameter_script_of_elements(
elements: list[ElementIdArrayItem],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Runs the parameter script of the library part of the given elements (objects, lamps, windows, doors, etc.), so that parameter values that depend on other parameters are updated, e.g. after SetGDLParametersOfElements.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
scale_elements ¶
scale_elements(
elements: list[ElementIdArrayItem],
center: Coordinate2D,
factor: float,
factor_y: None | float = None,
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Scales elements on the floor plan or in the current 2D view by a factor around a center point with Archicad's Resize edit, in one undo step. Resize scales X and Y by the same ratio, so factorY, if given, must equal factor. Elevations are kept: a beam, whose absolute elevation Resize would scale too, gets its story and level back after the resize. Supported types: Wall, Column, Beam, Slab, Roof, Mesh, Zone, Line, PolyLine, Arc, Circle, Spline, Hatch and Hotspot. An element of another type (library parts such as objects, lamps, doors and windows, stairs, railings, curtain walls, shells, morphs, texts, subelements, dimensions, labels, ...) or one that cannot be edited gets a failed execution result naming the reason, and the other elements are still scaled.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to scale: Wall, Column, Beam, Slab, Roof, Mesh, Zone, Line, PolyLine, Arc, Circle, Spline, Hatch or Hotspot, in the current database.
-
center(Coordinate2D) –The fixed point of the scaling on the floor plan; every point of the elements moves away from it (factor > 1) or towards it (factor < 1).
-
factor(float) –The scale factor, greater than 0: 2 doubles the distances from the center, 0.5 halves them.
-
factor_y(None | float, default:None) –Optional scale factor in Y. Archicad's Resize scales X and Y by one ratio, so it must be the same as factor (or left out); a different value is refused.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_category_values_of_defaults ¶
set_category_values_of_defaults(
element_types: list[ElementType],
category_values: list[DefaultCategoryValueData],
dry_run: None | bool = None,
) -> SetCategoryValuesOfDefaultsResult
Sets the category values (Structural Function, Position, Renovation Status ...) of the tool defaults of the given element types: the values new elements of the type get, as the Renovation palette does for the Renovation Status. Every given category value is set for every given element type, in a single undoable step, and read back. The value must belong to the given category, as GetElementCategories lists them. The executionResults have one item per element type and category value: for each element type, in the order of the input, one per item of categoryValues, in their order. An element type without that category, or a value Archicad did not keep, gets a failed execution result. The names are localized: use the type and the categoryValueId in scripts. With dryRun true nothing is changed and no undo step is created: the response has dryRun set to true, and each item that passes the checks made before writing gets wouldChange, with the default's value in the category now (oldValue) and the value a real run would set (newValue).
Parameters:
-
element_types(list[ElementType]) –The element types whose tool defaults (the settings new elements get) are set.
-
category_values(list[DefaultCategoryValueData]) –The category values to set for every element type: one category per item.
-
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:
set_category_values_of_elements ¶
set_category_values_of_elements(
element_category_values: list[ElementCategoryValueData],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the category values (Structural Function, Position, Renovation Status ...) of the given elements, one element and one category per item, in a single undoable step. The value must belong to the given category, as GetElementCategories lists them; an element without that category gets a failed execution result. The names are localized: use the type and the categoryValueId in scripts. With dryRun true nothing is changed and no undo step is created: the response has dryRun set to true, and each item that passes the checks made before writing gets wouldChange, with the element's value in the category now (oldValue) and the value a real run would set (newValue).
Parameters:
-
element_category_values(list[ElementCategoryValueData]) –The category values to set: one element and one category per item. The same element can appear in several items, one per category.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result per item of the input, in the same order. On a dry run an item that passes every check made before writing (the category and the value exist, the element exists and has the category) gets wouldChange: oldValue is the element's value in the category now and newValue the value a real run would set, both as GetCategoryValuesOfElements gives them (type, categoryId, categoryValueId and name; oldValue has only type and categoryId when the element has no value in the category). Archicad can still refuse an item that passes them.
set_category_values_of_elements_dry_run ¶
set_category_values_of_elements_dry_run(
element_category_values: list[ElementCategoryValueData],
) -> SetCategoryValuesOfElementsResult
Preview this command without applying its changes. Sets the category values (Structural Function, Position, Renovation Status ...) of the given elements, one element and one category per item, in a single undoable step. The value must belong to the given category, as GetElementCategories lists them; an element without that category gets a failed execution result. The names are localized: use the type and the categoryValueId in scripts. With dryRun true nothing is changed and no undo step is created: the response has dryRun set to true, and each item that passes the checks made before writing gets wouldChange, with the element's value in the category now (oldValue) and the value a real run would set (newValue).
Parameters:
-
element_category_values(list[ElementCategoryValueData]) –The category values to set: one element and one category per item. The same element can appear in several items, one per category.
Returns:
set_details_of_elements ¶
set_details_of_elements(
elements_with_details: list[ElementsWithDetail],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the details of the given elements. Every element type: Element ID (id), story (floorIndex), layer (layerIndex) and display order (drawIndex). In typeSpecificDetails: Wall - start and end point, height, base offset, and the start and end thickness of a trapezoid wall; Zone - the ZoneSettings fields (the same as ModifyZones); Line - start and end point, pen, line type, room separator; Arc and Circle - origin, radius, angle, ratio, start and end angle (arcs only), reflected, pen, line type, room separator; Polyline - points and arcs, pen, line type, room separator; Spline - pen, line type, room separator; Hatch - outline, holes, contour pen, fill pen and background pen or colors, fill or building material, area display, room special, fill orientation, fill category and contour line type; Hotspot - position, height, pen; Text - text, position, angle, height, justification; Label - the text of a text label; Drawing - position, angle, ratio, model offset, clip polygon (isCutWithFrame), name, ID and numbering, scale in Autotext, border, title library part, pen table (penTableUsageMode, penTableIndex), colorMode, isTransparentBackground, rasterizeDPI, the anchor (anchorPoint, useOwnOriginAsAnchor) and the Drawing Manager's update type (manualUpdate). Not written, because the Archicad API does not take them: the geometry of a Spline, the source of a Drawing (use ChangeDrawingLink), the Drawing Manager's stored in project, and often a placed Drawing's drawingScale, which comes from its source view (the element's result then names the kept value). Other wall, slab, column, beam, stair and object settings are written by their Modify commands, and the name, ID and clip polygon of Detail and Worksheet markers by ModifyDetailMarkers: typeSpecificDetails given for a Detail or Worksheet marker fail the item, and nothing of it is changed. An element Archicad does not let you edit (its layer is hidden or locked, it is locked, or it is not reserved by you in teamwork) gets a failed execution result naming the reason; a Drawing setting Archicad kept unchanged is named in a failed execution result too.
Parameters:
-
elements_with_details(list[ElementsWithDetail]) –The elements with parameters.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_element_fields ¶
set_element_fields(
elements_with_fields: list[ElementFieldsUpdate],
dry_run: None | bool = None,
) -> SetElementFieldsResult
Writes fields of elements by their path in the element's struct in the Archicad API (see GetElementFieldDefinitions), with ACAPI_Element_Change and a mask of exactly the given fields, in one undoable command. Each value is read back afterwards: one Archicad did not keep is reported as a failure that names the field and the value Archicad kept. A refusal or a value not kept also names the known condition behind it: the automatic story visibility (isAutoOnStoryVisibility), an arrowhead size or pen Archicad does not take, linked arrowheads, or a railing component Archicad generates from its node or segment.
Parameters:
-
elements_with_fields(list[ElementFieldsUpdate]) –The elements to change and the fields to write to each.
-
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:
set_element_info_strings ¶
set_element_info_strings(
elements: list[ElementInfoString],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the info string of the given elements: the Element ID shown in the Info Box, which GetDetailsOfElements returns as id. Returns one execution result per element.
Parameters:
-
elements(list[ElementInfoString]) –
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_element_notification_client ¶
set_element_notification_client(
port: int,
host: None | str = None,
notify_on_new_element: None | bool = None,
notify_on_modification_of_an_element: None
| bool = None,
notify_on_reservation_changes: None | bool = None,
*,
element_types_to_observe: None
| list[ElementType] = None,
elements_to_observe: None
| list[ElementIdArrayItem] = None,
notify_on_selection_change: None | bool = None,
notify_on_window_change: None | bool = None,
notify_on_project_events: None | bool = None,
notify_on_attribute_replacement: None | bool = None,
notify_on_tool_change: None | bool = None,
notify_on_view_events: None | bool = None,
notify_on_lockable_reservation_changes: None
| bool = None,
notify_on_tool_default_changes: None | bool = None,
notify_on_attribute_changes: None | bool = None,
notify_on_classification_changes: None | bool = None,
notify_on_property_definition_changes: None
| bool = None,
notify_on_marquee_change: None | bool = None,
notify_on_3d_settings_changes: None | bool = None,
) -> SuccessfulExecutionResult
Sets up a new notification client to receive element events.
Parameters:
-
port(int) –The port number of the notification client.
-
host(None | str, default:None) –The host address of the notification client. If not provided, localhost is used.
-
notify_on_new_element(None | bool, default:None) –Notify on creation of a new element. Optional parameter, by default true.
-
notify_on_modification_of_an_element(None | bool, default:None) –Notify on modification/deletion of an element. The observed elements are the ones ACAPI_Element_GetElemList returns, for API_ZombieElemID or, with elementTypesToObserve, for each of those types, when the first client asking for these notifications of them is registered, and every element of the observed types created after that, plus the elements listed in elementsToObserve. Archicad does not report the changes made by Tapir's own commands, so Tapir reports them itself for SetDetailsOfElements, SetPropertyValuesOfElements, MoveElements, RotateElements, MirrorElements (not for the copies they make, which are new elements), DeleteElements, DeleteSelectedElements, the Modify
commands (ModifyWalls, ModifyBeams, ModifySlabs, ModifyColumns, ModifyWindows, ModifyDoors, ModifyOpenings, ModifyMorphs, ModifyRoofs, ModifyShells, ModifyMeshes, ModifyObjects, ModifyLamps, ModifyTexts, ModifyLabels, ModifyCurtainWalls, ModifyCurtainWallFrames, ModifyZones, ModifySections, ModifyDetailMarkers, ModifyRailings, ModifyStairs, ModifyPolylines, ModifyHatches, ModifyChangeMarkers), ChangeTextContent, SetGDLParametersOfElements, RunParameterScriptOfElements (only when the script changed the element), SetMarkerParametersOfElements, SetMarkerLibraryPartOfElements, ChangeLibraryPartOfElements, SetClassificationsOfElements, SetCategoryValuesOfElements, ModifyPropertyValueOfElements, SetElementInfoStrings, SetURLReferencesOfElements, SetIFCAttributesOfElements, SetIFCPropertiesOfElements, RemoveIFCPropertiesOfElements, SetIFCClassificationReferencesOfElements, RemoveIFCClassificationReferencesOfElements, LockElements, UnlockElements, SetOpeningDetails, SetOpeningFloorPlanParameters, SetOpeningSymbolParameters, CreateGroups and UngroupElements (the grouped elements), MoveElementsToDesignOptions, CreateSolidElementLinks, RemoveSolidElementLinks, CreateSolidOperations (the target and operator when the operation changed or deleted them; the results are new elements), TrimElements, RemoveElementTrims, MergeElements, UnmergeElements, ModifyMEPRoutingElements, ModifyMEPPorts (the element owning the port), ConnectMEPElements, ModifyMEPElements, SetMEPRoutingParameters, ModifyElectricalPanels, ModifyElectricalDevices and ConnectToElectricalCircuits. Of the elements these commands change, only the given ones are reported: an element deleted together with its owner (a door or window of a deleted wall) is not. UpdateZones is not reported by Tapir, because Archicad updates the Zones after the command has returned. When the user moves, rotates, mirrors, elevates, resizes or stretches elements in Archicad, each of their changedElements items also has a transformation: {"type": ..., ...}, where type is "Drag" (with displacement: {"x", "y", "z"}), "Elevate" (with displacement, only z is not 0), "Rotate" (with origin: {"x", "y"} and angle, in radians, counterclockwise), "Mirror" (with origin, a point of the mirror axis, and axisDirection: {"x", "y"}, its unit vector), "Resize" (with origin and ratio), "Stretch", "VerticalStretch", "PreservedHeightStretch", "PreservedDirectionStretch" or "General"; the changes made by Tapir's own commands and by undo or redo have no transformation. Optional parameter, by default true. Archicad attaches an observer to each element to observe (see elementTypesToObserve and elementsToObserve) when the first client asks for this, and detaches them when the last one stops, and it is blocked meanwhile: one element at a time (the Archicad API has no call for many elements or a whole type), about 10 elements per second on a large project, and the time grows faster than the number of elements. Count the elements first (GetAllElements with IncludeSubElemObjects, or GetElementsByType) and limit the types, or list the elements with elementsToObserve, on large projects. -
notify_on_reservation_changes(None | bool, default:None) –Notify on reservation changes of an element. Optional parameter, by default true.
-
element_types_to_observe(None | list[ElementType], default:None) –Only modifications/deletions of elements of these types are observed and notified to this client, together with the elements of elementsToObserve. Optional parameter, by default (when neither elementTypesToObserve nor elementsToObserve is given) every element (including the parts of curtain walls, stairs and railings, which are most of the elements of large projects). Registering the same client again with other types changes them; only the elements of types no client observed before get an observer then. Does not limit the other notifications.
-
elements_to_observe(None | list[ElementIdArrayItem], default:None) –Only modifications/deletions of these elements are observed and notified to this client, together with the elements of the types of elementTypesToObserve. Only these elements get an observer, so registering takes time in proportion to their number, not to the size of the project (#2493). Unlike elementTypesToObserve, it does not cover the elements created later: with elementsToObserve alone, the changes of a new element are not notified (notifyOnNewElement still reports its creation); register the client again with the new element in the list to observe it. A listed element that does not exist fails the command, and the client is then not registered or changed. Registering the same client again with another list changes it; only the elements no client observed before get an observer then, and the ones no client needs any more lose theirs. Optional parameter, by default every element (see elementTypesToObserve). Does not limit the other notifications.
-
notify_on_selection_change(None | bool, default:None) –Notify when the selection changes. The message is {"selectedElements": [...]}: the whole current selection, each item an elementId as in the response of GetSelectedElements, an empty list when nothing is selected. Optional parameter, by default false.
-
notify_on_window_change(None | bool, default:None) –Notify when the current (active) window changes or the user switches to another story. The message is {"windowChanged": {"event": "Window" or "Floor", "windowType": ..., "databaseId": ..., "storyIndex": ...}}: windowType and databaseId describe the new current window as in the response of GetCurrentWindowType (databaseId is missing when that response has none), storyIndex is the active story, missing when it cannot be read. Optional parameter, by default false.
-
notify_on_project_events(None | bool, default:None) –Notify on project events. The message is {"projectEvent": ...}, one of "New", "NewAndReset", "Open", "Close", "Quit", "SendChanges" (a Teamwork send is about to start) and "ReceiveChanges" (Teamwork changes were received). The client stays registered when the project is closed or another one is opened. Optional parameter, by default false.
-
notify_on_attribute_replacement(None | bool, default:None) –Notify when attributes are deleted and replaced by other attributes of the same type (for example Delete and Replace in the Attribute Manager). The message is {"replacedAttributes": [{"attributeType": ..., "oldIndex": ..., "newIndex": ..., "newAttributeId": ...}, ...]}: attributeType is one of the type names of GetAttributesByType ("Layer", "Line", "Fill", "Composite", "Surface", "LayerCombination", "ZoneCategory", "Profile", "PenTable", "MEPSystem", "OperationProfile", "BuildingMaterial", or "Unknown"), oldIndex is the index of the replaced attribute and newIndex the index of the attribute that replaces it, newAttributeId is the attributeId of that attribute, missing when it cannot be found. Not available in Archicad 25: setting it to true there fails. Optional parameter, by default false.
-
notify_on_tool_change(None | bool, default:None) –Notify when the user switches to another tool in the Toolbox. The message is {"toolChanged": {"elementType": ...}}: elementType is the element type of the new tool, as in elementTypesToObserve (for example "Wall" or "Column"), "None" for the Arrow and the Marquee, and "Unknown" for a tool Tapir has no type name for. Optional parameter, by default false.
-
notify_on_view_events(None | bool, default:None) –Notify when an item of the Project Navigator or the Organizer is inserted (for example a view is saved or a layout is created), modified (for example renamed), deleted or opened. The message is {"viewEvent": {"event": ..., "navigatorMapId": ..., "navigatorItemId": {"guid": ...}}}: event is one of "Inserted", "Modified", "Deleted" and "Opened", navigatorMapId is the navigator map of the item, one of "ProjectMap", "PublicViewMap", "MyViewMap", "LayoutBook" and "PublisherSets" (as navigatorMapId of GetNavigatorItemTree), and navigatorItemId is the guid of the navigator item, as in the response of GetNavigatorItemTree (a deleted item no longer exists). Optional parameter, by default false.
-
notify_on_lockable_reservation_changes(None | bool, default:None) –Notify when a Teamwork lockable object set (the non-element things Teamwork reserves: the attributes of a type, favorites, model view options, project info, project preferences, ...) is reserved or released, by anyone, including the current user. The message is {"lockableReservationChanged": {"event": ..., "objectSetId": {"guid": ...}, "objectSetName": ..., "reservedBy": ..., "reservedByUserId": ...}}: event is "Reserved" or "Released", objectSetId is the guid of the object set, objectSetName its name as objectSetName of ReserveLockableObjectSet (for example "Composites", "LayerSettingsDialog" or "Favorites"), missing when it is not one of the documented sets, and reservedBy and reservedByUserId are the name and the Teamwork user id of the member who reserved it, only for "Reserved". Element reservations are notified by notifyOnReservationChanges. Optional parameter, by default false.
-
notify_on_tool_default_changes(None | bool, default:None) –Notify when the default settings of a tool change (for example the user changes the settings of the Wall tool with no wall selected), so a client can read the new defaults. The message is {"toolDefaultsChanged": {"elementType": ...}}: elementType is the element type whose defaults changed, as in elementTypesToObserve (for example "Wall" or "Column"), and "Unknown" for a type Tapir has no type name for. Optional parameter, by default false.
-
notify_on_attribute_changes(None | bool, default:None) –Notify when attributes (layers, fills, composites, surfaces, building materials, ...) are created, modified or deleted. The message is {"attributesChanged": {"event": ..., "attributeIds": [{"attributeId": {"guid": ...}}, ...]}}: event is "Created", "Modified" or "Deleted", and attributeIds are the attributes, as in the response of GetAttributesByType (a deleted attribute no longer exists). Not available in Archicad 25: setting it to true there fails. Optional parameter, by default false.
-
notify_on_classification_changes(None | bool, default:None) –Notify when classification systems or classification items are created, modified or deleted. The messages are {"classificationSystemsChanged": {"event": ..., "classificationSystemIds": [{"classificationSystemId": {"guid": ...}}, ...]}} and {"classificationItemsChanged": {"event": ..., "classificationItemIds": [{"classificationItemId": {"guid": ...}}, ...]}}: event is "Created", "Modified" or "Deleted", and the ids are as in the response of GetAllClassificationSystems and GetAllClassificationsInSystem. Not available in Archicad 25: setting it to true there fails. Optional parameter, by default false.
-
notify_on_property_definition_changes(None | bool, default:None) –Notify when property groups or property definitions are created, modified or deleted (property values of elements are notified as changedElements by notifyOnModificationOfAnElement). The messages are {"propertyGroupsChanged": {"event": ..., "propertyGroupIds": [{"propertyGroupId": {"guid": ...}}, ...]}} and {"propertyDefinitionsChanged": {"event": ..., "propertyIds": [{"propertyId": {"guid": ...}}, ...]}}: event is "Created", "Modified" or "Deleted", and the ids are as in the response of GetAllProperties. Not available in Archicad 25: setting it to true there fails. Optional parameter, by default false.
-
notify_on_marquee_change(None | bool, default:None) –Notify when the marquee is drawn, changed or removed. The message is {"marqueeChanged": {"type": ..., "multiStory": ...}}: type is "rectangle", "rotatedRectangle", "polygon" or, when the marquee was removed, "none", as type of GetMarquee, which returns the shape of the marquee; multiStory is missing for "none". Available from Archicad 27: setting it to true in an earlier version fails. Optional parameter, by default false.
-
notify_on_3d_settings_changes(None | bool, default:None) –Notify when the settings of the 3D window change (projection, Filter and Cut Elements in 3D, 3D window settings). The message is {"view3DSettingsChanged": {}}; read the new settings with the commands of the 3D window. The changes made while navigating in 3D are not notified. Available from Archicad 30: setting it to true in an earlier version fails. Optional parameter, by default false.
Returns:
set_fields_of_element_defaults ¶
set_fields_of_element_defaults(
fields_of_element_defaults: list[
ToolDefaultFieldsUpdate
],
dry_run: None | bool = None,
) -> SetFieldsOfElementDefaultsResult
Writes fields of the tool defaults of element types by their path in the element's struct in the Archicad API (see GetElementFieldDefinitions), with ACAPI_Element_ChangeDefaults and a mask of exactly the given fields: the elements created afterwards get them. Like the settings dialogs of the tools, it is not undoable. Each value is read back afterwards: one Archicad did not keep is reported as a failure that names the field and the value Archicad kept. A change Archicad refuses can still have written some of the given fields (seen with libInd, the library part, which Archicad refuses in the tool defaults): the failure names them.
Parameters:
-
fields_of_element_defaults(list[ToolDefaultFieldsUpdate]) –The element types whose tool defaults change and the fields to write to each.
-
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:
set_gdl_parameters_of_elements ¶
set_gdl_parameters_of_elements(
elements_with_gdl_parameters: list[
ElementsWithGDLParameter
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the given GDL parameters of the given elements. An element Archicad does not let the user edit (its layer locked, the element locked, or not reserved by the user in Teamwork) gets a failed execution result naming that reason, whatever the parameter. On a Curtain Wall Frame, A, B, ac_frameWidth and ac_frameDepth mirror the frame's contour, which Archicad derives from the frame's settings, so they are rejected instead of reporting a change that does not take effect; a frame without a library part (an invisible Boundary frame, for example) has no GDL parameters. The parameters are read back after the change, and a written parameter Archicad did not keep (e.g. one it sets from the element's own settings, like AC_TextSize_1 of a label, or one the object's Parameter Script sets back) gives a failed execution result naming it: each given value (a whole array too, but not A, B or a single array item) is compared with the value read back. With dryRun true no element is changed and no undo step is created: the parameters are written to the element's parameter list and its Parameter Script runs as in a real run, the response has dryRun set to true, and each element that passes the checks made before changing it gets wouldChange, listing the parameters a real run would change (the given ones and the ones the Parameter Script changes with them) with their old and new values. The railing components GetSubelementsOfHierarchicalElements lists (posts, rails, balusters, panels ...) have no parameter session in the Archicad API: their parameters are written to the component itself, no Parameter Script runs (a dry run lists only the given parameters), array parameters are not supported, and a value Archicad does not keep (one the railing's settings set) gives a failed execution result naming it.
Parameters:
-
elements_with_gdl_parameters(list[ElementsWithGDLParameter]) –The elements with GDL parameters dictionary pairs.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each item of elementsWithGDLParameters, in the order of the input. On a dry run the parameters are written to the element's parameter list and its Parameter Script runs as in a real run, but the element is not changed. An element that passes every check made before changing it (the element and its parameters exist, every value is valid for its parameter, the element is editable) gets wouldChange: oldValue and newValue list the parameters a real run would change - the ones given and the ones the Parameter Script changes with them - before and after, each with name, index, type and value as GetGDLParametersOfElements gives them. Archicad can still refuse an element that passes them.
set_gdl_parameters_of_elements_dry_run ¶
set_gdl_parameters_of_elements_dry_run(
elements_with_gdl_parameters: list[
ElementsWithGDLParameter
],
) -> SetGDLParametersOfElementsResult
Preview this command without applying its changes. Sets the given GDL parameters of the given elements. An element Archicad does not let the user edit (its layer locked, the element locked, or not reserved by the user in Teamwork) gets a failed execution result naming that reason, whatever the parameter. On a Curtain Wall Frame, A, B, ac_frameWidth and ac_frameDepth mirror the frame's contour, which Archicad derives from the frame's settings, so they are rejected instead of reporting a change that does not take effect; a frame without a library part (an invisible Boundary frame, for example) has no GDL parameters. The parameters are read back after the change, and a written parameter Archicad did not keep (e.g. one it sets from the element's own settings, like AC_TextSize_1 of a label, or one the object's Parameter Script sets back) gives a failed execution result naming it: each given value (a whole array too, but not A, B or a single array item) is compared with the value read back. With dryRun true no element is changed and no undo step is created: the parameters are written to the element's parameter list and its Parameter Script runs as in a real run, the response has dryRun set to true, and each element that passes the checks made before changing it gets wouldChange, listing the parameters a real run would change (the given ones and the ones the Parameter Script changes with them) with their old and new values. The railing components GetSubelementsOfHierarchicalElements lists (posts, rails, balusters, panels ...) have no parameter session in the Archicad API: their parameters are written to the component itself, no Parameter Script runs (a dry run lists only the given parameters), array parameters are not supported, and a value Archicad does not keep (one the railing's settings set) gives a failed execution result naming it.
Parameters:
-
elements_with_gdl_parameters(list[ElementsWithGDLParameter]) –The elements with GDL parameters dictionary pairs.
Returns:
set_linked_property_objects_of_elements ¶
set_linked_property_objects_of_elements(
elements_with_linked_property_objects: list[
LinkedPropertyObjectsByElement
| LinkedPropertyObjectsByToolDefault
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets how property objects (the library parts of the old listing system) are linked to the given elements, or to the element defaults of the given element types: whether the property objects matching their criteria are linked, and which one is assigned individually (0 removes the individual assignment). A link that is not given stays unchanged. All changes are made in one undoable step.
Parameters:
-
elements_with_linked_property_objects(list[LinkedPropertyObjectsByElement | LinkedPropertyObjectsByToolDefault]) –The property object links to set, each for an element or for the element defaults of an element type. A link that is not given stays unchanged.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_marker_library_part_of_elements ¶
set_marker_library_part_of_elements(
elements_with_marker_library_part: list[
ElementsWithMarkerLibraryPartItem
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Changes which library part the marker of the given Window and Door elements uses, given by its name (find the available ones with GetAvailableLibraryParts); only a marker library part for the opening's type is accepted. The marker gets the new library part's default parameters, which SetMarkerParametersOfElements can change afterwards; the opening's own settings are left as they are.
Parameters:
-
elements_with_marker_library_part(list[ElementsWithMarkerLibraryPartItem]) –The elements with the library part their marker should use.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_marker_parameters_of_elements ¶
set_marker_parameters_of_elements(
elements_with_marker_parameters: list[
ElementWithMarkerParameters
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the given GDL parameters of the marker of the given Window, Door and Change Marker elements (the marker head of a Change Marker). The element's own settings and the other marker parameters are left as they are.
Parameters:
-
elements_with_marker_parameters(list[ElementWithMarkerParameters]) –The elements with the marker parameters to change.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_marquee ¶
set_marquee(
polygon: None | list[Coordinate2D] = None,
box: BoundingBox2D | None = None,
rotation_angle: None | float = None,
multi_story: None | bool = None,
) -> SuccessfulExecutionResult
Draws a marquee in the current window from a polygon or a box (optionally rotated), single- or multi-story. Called without polygon and box it removes the marquee.
Parameters:
-
polygon(None | list[Coordinate2D], default:None) –The vertices of a polygon marquee, in order. The polygon is closed automatically; a repeated first vertex at the end is accepted. Give either polygon or box.
-
box(BoundingBox2D | None, default:None) –A rectangle marquee. With rotationAngle it is a rotated rectangle, and the box is read the way Archicad stores it (see GetMarquee): in the coordinate system rotated by rotationAngle around the project origin. Give either polygon or box.
-
rotation_angle(None | float, default:None) –Rotation angle (radians) of the box around the project origin. Only together with box. The default is 0: a horizontal rectangle.
-
multi_story(None | bool, default:None) –True for a multi-story (thick) marquee, false for a single-story (thin) one. The default is false.
Returns:
set_opening_default ¶
set_opening_default(
extrusion_parameters: None
| OpeningExtrusionParametersUpdate = None,
floor_plan_parameters: None
| OpeningFloorPlanParametersUpdate = None,
) -> ElementType
Changes the settings of the Opening tool defaults, with the names GetOpeningDefault returns. Only the given settings change. Available from Archicad 29.
Parameters:
-
extrusion_parameters(None | OpeningExtrusionParametersUpdate, default:None) –The size and extrusion settings to change, with the names GetOpeningDetails returns. The ones left out are not changed.
-
floor_plan_parameters(None | OpeningFloorPlanParametersUpdate, default:None) –The floor plan settings to change, with the names GetOpeningDefault returns. The ones left out are not changed.
Returns:
-
ElementType–The type of the elements the changed settings are the defaults of.
set_opening_details ¶
set_opening_details(
openings_with_details: list[OpeningModificationData],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Changes the details of Opening elements: the parent element, the cut elements, the polygon, a transformation of the geometry and the extrusion parameters (constraint, limit type, linked status, shape type, size, anchor, offsets, surface overrides) returned by GetOpeningDetails. Available from Archicad 29.
Parameters:
-
openings_with_details(list[OpeningModificationData]) –The Opening elements (made with the Opening tool) to change, each with the details to set. A detail that is left out stays as it is.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_opening_floor_plan_parameters ¶
set_opening_floor_plan_parameters(
openings_with_floor_plan_parameters: list[
OpeningFloorPlanModificationData
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Changes the floor plan parameters of Opening elements returned by GetOpeningFloorPlanParameters, and sets or removes their cut and uncut symbols. Available from Archicad 29.
Parameters:
-
openings_with_floor_plan_parameters(list[OpeningFloorPlanModificationData]) –
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_opening_symbol_parameters ¶
set_opening_symbol_parameters(
elements: list[OpeningSymbolParametersUpdate],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Changes the GDL parameters of the cut and uncut floor plan symbols of Opening elements, in the format of SetGDLParametersOfElements. Only the given parameters are changed. Available from Archicad 29.
Parameters:
-
elements(list[OpeningSymbolParametersUpdate]) –
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_url_references_of_elements ¶
set_url_references_of_elements(
elements_with_url_references: list[
ElementURLReferenceUpdate
],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Sets the web link (URL reference) of the given elements: a URL with a description, shown in Archicad in the element's settings under Element Information > Link. Without a description the URL is used as the description. Fails with APIERR_MOREUSER for an element that already holds a link.
Parameters:
-
elements_with_url_references(list[ElementURLReferenceUpdate]) –The elements and the web link to set on each.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
set_zone_labeling_settings ¶
set_zone_labeling_settings(
automatic_labeling: None | bool = None,
favorite_name: None | str = None,
) -> SuccessfulExecutionResult
Turns the automatic labeling of Zones on or off and selects the Label Favorite it places. Only the given settings are changed. Available from Archicad 28.
Parameters:
-
automatic_labeling(None | bool, default:None) –Turns the automatic labeling of Zones (placing a Label on each new Zone) on or off.
-
favorite_name(None | str, default:None) –The name of the Label Favorite that is placed on each new Zone by the automatic labeling.
Returns:
set_zone_stamp_of_defaults ¶
set_zone_stamp_of_defaults(
library_part: LibraryPartByGuid
| LibraryPartByIndex
| LibraryPartByName
| None = None,
use_stamp_of_category: None | bool = None,
category_attribute_id: AttributeId | None = None,
) -> SetZoneStampOfDefaultsResult
Changes the zone stamp and/or the Zone Category of the Zone tool defaults. The zone stamp is given by name, index or guid (libraryPart), or taken from the Zone Category (useStampOfCategory); the defaults get the new stamp's own parameters. Returns the zone stamp read back. Use it when CreateZones fails because the default zone stamp is missing (see GetZoneStampOfDefaults); like a change in the Zone Settings dialog, it is saved with the project.
Parameters:
-
library_part(LibraryPartByGuid | LibraryPartByIndex | LibraryPartByName | None, default:None) –The new zone stamp of the Zone tool defaults, given by one of name, index or guid. It has to be a zone stamp library part in the loaded libraries. Do not combine with useStampOfCategory.
-
use_stamp_of_category(None | bool, default:None) –When true, the Zone tool defaults get the zone stamp of their Zone Category (the one given in categoryAttributeId, else the current one), as Archicad does when a category is picked in the Zone Settings. Fails when that stamp is not in the loaded libraries. Do not combine with libraryPart.
-
category_attribute_id(AttributeId | None, default:None) –The new Zone Category of the Zone tool defaults. Without libraryPart or useStampOfCategory the zone stamp is kept.
Returns:
solve_stair_baseline ¶
solve_stair_baseline(
stairs_data: list[StairBaselineData],
) -> list[ErrorItem | StairBaselineSolution]
Runs the Archicad stair solver on the given Stair baselines (straight or with curved edges) and parameters without creating any element. Returns for each one whether the baseline was already correct, could be solved or could not be solved, with the baseline and the main stair settings after solving, and the Rules and Standards (riser height and going limits, 2R+G, R+G, R/G, pitch) CreateStairs would lay the steps out by, with a given treadDepth pinned as CreateStairs pins it. The solver checks the baseline only: it does not lay out the steps, so stepNum, riserHeight and treadDepth are the given values or the tool defaults, and CreateStairs picks the riser count and height for totalHeight within the rules. Available from Archicad 27.
Parameters:
-
stairs_data(list[StairBaselineData]) –Array of Stair data to check, with the same fields as the items of CreateStairs (without favoriteName). Nothing is created.
Returns:
-
list[ErrorItem | StairBaselineSolution]–The results of the stair solver, aligned with the input stairsData.
split_elements ¶
split_elements(
elements: list[ElementIdArrayItem], line: Line
) -> list[ElementNotSplit | ErrorItem | SplitElementParts]
Splits each given element along a line (the infinite line through its begin and end point, like Archicad's Split command). The original element keeps one part, copies of it (Drag a Copy, so they keep the layer, classifications, properties and every other setting) get the others; all are returned, the original first. Supports straight walls without doors, windows or openings, straight unslanted single segment beams without holes or openings, and lines (their arrows stay at the original ends), which are split in two, the original keeping the part from its begin point; and slabs, meshes without level lines or points, fills and single contour polylines, whose polygon (holes and arcs included) or points are cut along the line into one part per piece, the original keeping the largest piece (a polyline: the piece with its begin point). Slab edges keep their trim and side surface, the edges along the line are vertical; the corners a mesh gets on the line take their height from the edge they lie on. An element the line does not cross is reported as notCut, an unsupported one as an error naming its type. One undo step.
Parameters:
-
elements(list[ElementIdArrayItem]) –The elements to split. Supported: straight walls (not polygonal, without doors, windows or openings), straight beams (not slanted or curved, one segment, without holes or openings), lines, slabs, meshes (without level lines or points), fills and polylines (one contour). Other types are reported with their type name.
-
line(Line) –The split line in project coordinates: the infinite line through begin and end, as the split line of Archicad's Split command.
Returns:
-
list[ElementNotSplit | ErrorItem | SplitElementParts]–One item per given element, in the same order.
triangulate_polygons_of_elements ¶
triangulate_polygons_of_elements(
elements: list[ElementIdArrayItem],
convex: None | bool = None,
) -> list[
ElementConvexPolygons | ElementTriangulation | ErrorItem
]
Triangulates the plan polygon of the given elements, holes excluded, as Archicad does it: the outline of a Slab, Zone, Hatch or Mesh and the polygon of a Roof. Each triangle is given by the 2D coordinates of its three vertices. With convex: true, the faces of the 3D model of the elements (of any type) are decomposed into convex polygons instead, given by the 3D coordinates of their vertices. The output is aligned with the input array of elements; an element of another type gets an error item.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
-
convex(None | bool, default:None) –Optional. When true, the faces of the 3D model of each element (its own bodies, any element type) are decomposed into convex polygons instead, as Archicad does it, and returned as convexPolygons. Default value is false.
Returns:
-
list[ElementConvexPolygons | ElementTriangulation | ErrorItem]–The triangulation of the polygon of each element, aligned with the input: its triangles (or with convex: true its convex polygons), or an error (for example for an element type that has no polygon).
unlink_elements ¶
unlink_elements(
links: list[ElementLinkReference],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes the links created by LinkElements between the given pairs of elements. The direction matters: the link starting from fromElementId and pointing to toElementId is removed. Undoable.
Parameters:
-
links(list[ElementLinkReference]) –The links to remove, each from one element to another.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result per link, aligned with the input.
unlock_elements ¶
unlock_elements(
elements: list[ElementIdArrayItem],
) -> SuccessfulExecutionResult
Unlocks the given elements. Manual lock, not teamwork!
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
update_zones ¶
update_zones(
keep_stamp_position: None | bool = None,
undo_top_trim: None | bool = None,
undo_bottom_trim: None | bool = None,
*,
zones: None | list[ElementIdArrayItem] = None,
) -> SuccessfulExecutionResult
Updates Zones (recalculates their geometry, updates their Zone Stamps and the connected elements): the selected Zones, every Zone when nothing is selected, or the Zones given in zones. Archicad runs the update right after the command has returned, on the Zones selected at that moment, so the new geometry can only be read with a later command.
Parameters:
-
keep_stamp_position(None | bool, default:None) –Keep the position of the Zone Stamps. The default is true.
-
undo_top_trim(None | bool, default:None) –Undo the trimming of the top of the Zones. The default is false.
-
undo_bottom_trim(None | bool, default:None) –Undo the trimming of the bottom of the Zones. The default is false.
-
zones(None | list[ElementIdArrayItem], default:None) –Optional list of the Zones to update, on any story. They are selected instead of the current selection and stay selected: Archicad updates the selected Zones right after the command has returned, not during it, and clears the selection when it is done. So do not change the selection until then, and read the new geometry with a later command. Every Zone is checked first; if one cannot be updated (not a Zone, listed twice, hidden or locked layer, not editable), nothing is selected or updated. An empty list updates nothing. Without the list the current selection is updated, or every Zone when nothing is selected.
Returns:
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.
AlignElementsParametersAlignElementsResultCaptureElementStateParametersCaptureElementStateResultChangeLibraryPartOfElementsParametersChangeLibraryPartOfElementsResultChangeSelectionOfElementsParametersChangeSelectionOfElementsResultChangeTextContentParametersChangeTextContentResultConvertRevealOffsetsParametersConvertRevealOffsetsResultCopyElementsParametersCopyElementsResultCopyElementsToDatabaseParametersCopyElementsToDatabaseResultDeleteElementsParametersDeleteElementsResultDeleteSelectedElementsParametersDeleteSelectedElementsResultDeleteUserDataOfElementsParametersDeleteUserDataOfElementsResultDistributeElementsParametersDistributeElementsResultEditHierarchicalElementParametersElevateElementsParametersElevateElementsResultFilterElementsParametersFilterElementsResultFinishHierarchicalEditingParametersGet2DBoundingBoxesParametersGet2DBoundingBoxesResultGet3DBoundingBoxesParametersGet3DBoundingBoxesResultGet3DGeometryOfElementsParametersGet3DGeometryOfElementsResultGet3DModelCountsResultGetAllElementsParametersGetBodyMaterialsOfElementsParametersGetBodyMaterialsOfElementsResultGetCalculatedParametersOfCurtainWallSubElementsParametersGetCalculatedParametersOfCurtainWallSubElementsResultGetCategoryValuesOfDefaultsParametersGetCategoryValuesOfDefaultsResultGetCategoryValuesOfElementsParametersGetCategoryValuesOfElementsResultGetCollisionsParametersGetCollisionsResultGetConnectedElementsParametersGetCurtainWallAbsoluteBottomsParametersGetCurtainWallAbsoluteBottomsResultGetCutPolygonsOfElementsParametersGetCutPolygonsOfElementsResultGetDescriptorsOfElementsParametersGetDescriptorsOfElementsResultGetDetailsOfElementsParametersGetDetailsOfElementsResultGetDimensionDataParametersGetDimensionDataResultGetDrawingPrimitivesOfElementsParametersGetDrawingPrimitivesOfElementsResultGetElementAtCoordinateParametersGetElementAtCoordinateResultGetElementCategoriesResultGetElementChangesSinceParametersGetElementChangesSinceResultGetElementConnectionsParametersGetElementConnectionsResultGetElementFieldDefinitionsParametersGetElementFieldDefinitionsResultGetElementFieldsParametersGetElementFieldsResultGetElementPreviewImageParametersGetElementPreviewImageResultGetElementTypeNamesParametersGetElementTypeNamesResultGetElementsByCriteriaParametersGetElementsByCriteriaResultGetElementsByTypeParametersGetElementsInCreationOrderParametersGetElementsInDrawOrderParametersGetFieldsOfElementDefaultsParametersGetFieldsOfElementDefaultsResultGetGDLParametersOfElementsParametersGetGDLParametersOfElementsResultGetGridElementDefaultsParametersGetGridElementDefaultsResultGetGridElementsParametersGetGridElementsResultGetHierarchicalElementOwnersParametersGetHierarchicalElementOwnersResultGetHotspotsOfElementsParametersGetHotspotsOfElementsResultGetLibPartTransformationsParametersGetLibPartTransformationsResultGetLinkedPropertyObjectsOfElementsParametersGetLinkedPropertyObjectsOfElementsResultGetLinksOfElementsParametersGetLinksOfElementsResultGetMarkerParametersOfElementsParametersGetMarkerParametersOfElementsResultGetMarqueeResultGetModelExtentResultGetOpeningDefaultParametersGetOpeningDefaultResultGetOpeningDetailsParametersGetOpeningDetailsResultGetOpeningFloorPlanParametersParametersGetOpeningFloorPlanParametersResultGetOpeningSymbolParametersParametersGetOpeningSymbolParametersResultGetOpeningTransformationsParametersGetOpeningTransformationsResultGetPolygonVertexIdsOfElementsParametersGetPolygonVertexIdsOfElementsResultGetProfileValuesOfElementsParametersGetProfileValuesOfElementsResultGetPropertyObjectsOfElementsParametersGetPropertyObjectsOfElementsResultGetQuantitiesOfElementsParametersGetQuantitiesOfElementsResultGetRailingSegmentPatternsParametersGetRailingSegmentPatternsResultGetRelationsOfElementsParametersGetRelationsOfElementsResultGetRoofPlanesParametersGetRoofPlanesResultGetRoomImageParametersGetRoomImageResultGetSectionElementsParametersGetSectionElementsResultGetSelectedElementsResultGetShapePrimitivesOfElementsParametersGetShapePrimitivesOfElementsResultGetSkylightHolePolygonsParametersGetSkylightHolePolygonsResultGetSnapPointsOfElementsParametersGetSnapPointsOfElementsResultGetSplineMaxDistancesParametersGetSplineMaxDistancesResultGetStoryControlPrimitivesParametersGetStoryControlPrimitivesResultGetSubelementsOfHierarchicalElementsParametersGetSubelementsOfHierarchicalElementsResultGetSurfaceQuantitiesOfElementsParametersGetSurfaceQuantitiesOfElementsResultGetSurfaceTypesOfElementsParametersGetSurfaceTypesOfElementsResultGetTextureCoordinatesParametersGetTextureCoordinatesResultGetURLReferencesOfElementsParametersGetURLReferencesOfElementsResultGetVisibleSkinStatusParametersGetVisibleSkinStatusResultGetZoneBoundariesParametersGetZoneLabelingSettingsResultGetZoneReductionsParametersGetZoneReductionsResultGetZoneStampOfDefaultsResultHighlightElementsParametersLinkElementsParametersLinkElementsResultLockElementsParametersMeasureTextsParametersMeasureTextsResultMirrorElementsParametersMirrorElementsResultMoveElementsParametersMoveElementsResultPlaceOpeningsParametersPlaceOpeningsResultRecreateAngleDimensionsParametersRecreateAngleDimensionsResultRecreateCurtainWallsParametersRecreateCurtainWallsResultRecreateDoorsParametersRecreateDoorsResultRecreateRailingsParametersRecreateRailingsResultRecreateSkylightsParametersRecreateSkylightsResultRecreateStairsParametersRecreateStairsResultRecreateWindowsParametersRecreateWindowsResultRecreateZonesParametersRecreateZonesResultRefreshElementsParametersRefreshElementsResultRegularizePolygonsParametersRegularizePolygonsResultRegularizePolylinesParametersRegularizePolylinesResultReleaseElementStateParametersRemoveElementNotificationClientParametersRotateCopyElementsParametersRotateCopyElementsResultRotateElementsParametersRotateElementsResultRunParameterScriptOfElementsParametersRunParameterScriptOfElementsResultScaleElementsParametersScaleElementsResultSetCategoryValuesOfDefaultsParametersSetCategoryValuesOfDefaultsResultSetCategoryValuesOfElementsParametersSetCategoryValuesOfElementsResultSetDetailsOfElementsParametersSetDetailsOfElementsResultSetElementFieldsParametersSetElementFieldsResultSetElementInfoStringsParametersSetElementInfoStringsResultSetElementNotificationClientParametersSetFieldsOfElementDefaultsParametersSetFieldsOfElementDefaultsResultSetGDLParametersOfElementsParametersSetGDLParametersOfElementsResultSetLinkedPropertyObjectsOfElementsParametersSetLinkedPropertyObjectsOfElementsResultSetMarkerLibraryPartOfElementsParametersSetMarkerLibraryPartOfElementsResultSetMarkerParametersOfElementsParametersSetMarkerParametersOfElementsResultSetMarqueeParametersSetOpeningDefaultParametersSetOpeningDefaultResultSetOpeningDetailsParametersSetOpeningDetailsResultSetOpeningFloorPlanParametersParametersSetOpeningFloorPlanParametersResultSetOpeningSymbolParametersParametersSetOpeningSymbolParametersResultSetURLReferencesOfElementsParametersSetURLReferencesOfElementsResultSetZoneLabelingSettingsParametersSetZoneStampOfDefaultsParametersSetZoneStampOfDefaultsResultSolveStairBaselineParametersSolveStairBaselineResultSplitElementsParametersSplitElementsResultTriangulatePolygonsOfElementsParametersTriangulatePolygonsOfElementsResultUnlinkElementsParametersUnlinkElementsResultUnlockElementsParametersUpdateZonesParametersAlignToAngleDimensionRecreationDataAttributeIdBeamRelationsBeamSegmentRelationsBoundingBox2DBoundingBox2DArrayItemBoundingBox3DBoundingBox3DArrayItemCalculatedParametersOfElementsCollisionCollisionCheckSettingsColorRGBConnectedElementsWrapperCoordinate2DCoordinate3DCopyCurtainWallAbsoluteBottomCurtainWallRecreationDataDatabaseIdDatabaseIdArrayItemDefaultCategoryValueDataDefaultCategoryValuesDetailsOfElementDimensionDataDirectionDoorRecreationDataDrawingPrimitiveElementElementBodyMaterialsElementCategoryDetailsElementCategoryTypeElementCategoryValueDataElementCategoryValuesElementConvexPolygonsElementCutPlaneElementCutPolygonsElementDescriptorsElementDetailsAdditionalFieldElementDetailsFieldElementDrawingPrimitivesElementFieldValuesElementFieldsUpdateElementFilterElementGeometry3DElementHeaderFromOtherDatabaseElementHotspotsElementIdElementIdArrayItemElementInfoStringElementLibraryPartChangeElementLibraryPartTransformationElementLinkDataElementLinkReferenceElementLinkedPropertyObjectsElementLinksElementMirrorDataElementNotSplitElementPolygonVertexIdsElementProfileValuesElementPropertyObjectsElementQuantityDetailsElementStateIdElementStateTypeElementSurfaceQuantitiesElementSurfaceTypesElementTextureCoordinatesElementTriangulationElementTypeElementTypeFloorLayerFilterElementTypeNameElementURLReferenceElementURLReferenceUpdateElementWithMarkerParametersElementsWithDetailElementsWithElevationElementsWithExecutionResultsElementsWithGDLParameterElementsWithMarkerLibraryPartItemElementsWithMoveVectorElementsWithRotationErrorItemExecutionResultFailedExecutionResultFormatGDLParameterListGridElementDetailsHierarchicalElementOwnerHierarchicalOwnerModeImageTypeLibraryPartByGuidLibraryPartByIndexLibraryPartByNameLineLinkedPropertyObjectsByElementLinkedPropertyObjectsByToolDefaultMarkerParametersOfElementModeModel3DCountOpeningDetailsOpeningExtrusionParametersUpdateOpeningFloorPlanDetailsOpeningFloorPlanModificationDataOpeningFloorPlanParametersUpdateOpeningModificationDataOpeningPlacementDataOpeningRelationsOfElementOpeningRevealOffsetDataOpeningRevealOffsetsOpeningSymbolParametersOpeningSymbolParametersUpdateOpeningTransformationPartialStructureDisplayPolygonRegularizationDataPolylineRegularizationDataPropertyCriterionPropertyObjectToolDefaultRailingRecreationDataRailingSegmentPatternsResultRecreatedElementRegularizedPolygonsRegularizedPolylineRoofOrShellRelationsOfElementRoofPlanesOfElementsSkylightHolePolygonSkylightRecreationDataSnapPointsOfElementsSplineDistanceInputSplineMaxDistanceSplitElementPartsStairBaselineDataStairBaselineSolutionStairRecreationDataSubelementSuccessfulExecutionResultTextContentChangeTextMeasurementTextMeasurementDataToolDefaultFieldValuesToolDefaultFieldsUpdateVisibleSkinStatusWallRelationsWindowRecreationDataZoneBoundariesOfZonesWrapperZoneBoundariesWrapperZoneRecreationDataZoneReductionsZoneRelationsOfElement