Solid Element Operation¶
Create and inspect solid element operations, trims and merges, and remove their relationships.
Access this group through api.tapir.solid_element_operation.
Commands¶
No commands match. Try another name or clear the filter.
For exceptions shared by Unified API commands, see error handling.
create_solid_element_links ¶
create_solid_element_links(
solid_links: list[SolidLinkData],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Creates solid element operation links between target and operator elements. An MEP route is linked by its routing element (the whole route, with its elbows, is the operator) or by one of its rigid segments; a routing segment has no 3D body of its own and is refused. The cut is in the target's 3D model (Get3DGeometryOfElements); the floor plan symbol of a Slab does not show it, unlike a hole of its polygon.
Parameters:
-
solid_links(list[SolidLinkData]) –List of solid element operation links to create.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
create_solid_operations ¶
create_solid_operations(
operations: list[SolidOperationData],
) -> list[ErrorItem | SolidOperationResult]
Runs a solid operation (subtraction, intersection, addition) on two morphs and returns the resulting morphs, one item per operation. Unlike CreateSolidElementLinks this is not a link: the target and the operator morph are replaced by the result. Morphs only; the operations run in one undo step.
Parameters:
-
operations(list[SolidOperationData]) –The solid operations to run, each on two morphs. The target and the operator morph are replaced by the resulting morph.
Returns:
-
list[ErrorItem | SolidOperationResult]–One item per operation, in the order of the input: the resulting morphs, or an error.
get_element_trims ¶
get_element_trims(
elements: list[ElementIdArrayItem],
) -> list[ElementTrims | ErrorItem]
Which roofs and shells trim each queried element, with the trim type, and which elements it trims.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ElementTrims | ErrorItem]–One item per queried element, in order. An unknown or deleted element is an error item, so it cannot be mistaken for an element that is simply not trimmed.
get_merged_elements ¶
get_merged_elements(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | MergedElements]
Gets the elements each queried element is merged with, one item per queried element; an unknown element is an error item.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | MergedElements]–One item per queried element, in order: the elements it is merged with. An unknown or deleted element is an error item, so it cannot be mistaken for an element that is simply not merged.
get_solid_element_links ¶
get_solid_element_links(
elements: list[ElementIdArrayItem],
) -> list[SolidLinksOfElement]
Returns solid element operation links for each queried element, grouped by role (target or operator).
Parameters:
-
elements(list[ElementIdArrayItem]) –Elements to query. Returns all solid links where each element is a target or an operator.
Returns:
-
list[SolidLinksOfElement]–For each input element, the solid links where it acts as target and where it acts as operator.
merge_elements ¶
merge_elements(
elements: list[ElementIdArrayItem],
) -> SuccessfulExecutionResult
Merges the given construction elements (the Merge command of Archicad, which cleans up the junctions of slabs, beams, walls and similar elements). Undoable. The element types are not filtered: Archicad reports the ones it cannot merge. The merge is read back: when Archicad records no merge between the given elements (it decides which elements and type combinations it merges), the result is a failure, not a success.
Parameters:
-
elements(list[ElementIdArrayItem]) –The construction elements to merge together. At least two.
Returns:
remove_element_trim_direction ¶
remove_element_trim_direction(
element_pairs: list[ElementTrimPair],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes one direction of a trim: the trim of an element by a roof or shell, keeping the other direction when the two trim each other (two roofs or shells). The Archicad API can only remove both directions at once, so the command reads the other direction and its trim type, removes the trim and trims the other direction again, in one undo step, and reads the result back. A pair whose element is not trimmed by its trimming element fails without changing anything; when Archicad fails to remove or trim again, the whole call is undone.
Parameters:
-
element_pairs(list[ElementTrimPair]) –Per pair, the trim of elementId by trimmingElementId is removed. When trimmingElementId is trimmed by elementId too (two roofs or shells trimming each other), that other direction is kept, with its trim type. The pairs are done in order, each on the trims the pairs before it left, so the two pairs of two roofs remove both directions.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input pair, in the order of the input. A pair whose element is not trimmed by its trimming element fails and changes nothing. When Archicad fails to remove a trim or to trim the kept direction again, the whole call is undone and every pair fails, the pair that failed with the reason.
remove_element_trims ¶
remove_element_trims(
element_pairs: list[ElementTrimPair],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes the trim between an element and the roof or shell trimming it. The Archicad API removes the trimming connection between the two elements, so when they trim each other (two roofs or shells) both directions are removed; trim the other direction again with TrimElements to keep it. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each pair whose element is trimmed by its trimming element gets wouldDelete.
Parameters:
-
element_pairs(list[ElementTrimPair]) –The trimmed element and the roof or shell trimming it, per pair. The trimming connection between the two is removed: when they trim each other, both directions are removed.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input pair, in the order of the input. On a dry run a pair whose element is trimmed by the trimming element gets wouldDelete.
remove_element_trims_dry_run ¶
remove_element_trims_dry_run(
element_pairs: list[ElementTrimPair],
) -> RemoveElementTrimsResult
Preview this command without applying its changes. Removes the trim between an element and the roof or shell trimming it. The Archicad API removes the trimming connection between the two elements, so when they trim each other (two roofs or shells) both directions are removed; trim the other direction again with TrimElements to keep it. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each pair whose element is trimmed by its trimming element gets wouldDelete.
Parameters:
-
element_pairs(list[ElementTrimPair]) –The trimmed element and the roof or shell trimming it, per pair. The trimming connection between the two is removed: when they trim each other, both directions are removed.
Returns:
remove_solid_element_links ¶
remove_solid_element_links(
solid_links: list[SolidLinkReference],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes solid element operation links between target and operator elements. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each link that exists gets wouldDelete.
Parameters:
-
solid_links(list[SolidLinkReference]) –List of solid element operation links to remove.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–One result for each input link, in the order of the input. On a dry run a link that exists (the operator is linked to the target) gets wouldDelete.
remove_solid_element_links_dry_run ¶
remove_solid_element_links_dry_run(
solid_links: list[SolidLinkReference],
) -> RemoveSolidElementLinksResult
Preview this command without applying its changes. Removes solid element operation links between target and operator elements. With dryRun true nothing is removed and no undo step is created: the response has dryRun set to true, and each link that exists gets wouldDelete.
Parameters:
-
solid_links(list[SolidLinkReference]) –List of solid element operation links to remove.
Returns:
trim_elements ¶
trim_elements(
elements: list[ElementIdArrayItem],
trimming_element: ElementId | None = None,
trim_type: None | TrimType = None,
) -> SuccessfulExecutionResult
Trims construction elements with a roof or shell: the roofs and shells in the list, or one given trimming element with a trim type. With several roofs or shells in the list Archicad decides which of them trims which element (they may also trim each other), so not every element is necessarily trimmed by each; to trim each element with each roof or shell, call it once per roof or shell with trimmingElement, and check the result with GetElementTrims.
Parameters:
-
elements(list[ElementIdArrayItem]) –The construction elements to trim. Without trimmingElement the roofs and shells among them do the trimming: Archicad decides which roof or shell trims which element and with which trim type, and may trim the roofs and shells with each other, so not every element is necessarily trimmed by every roof or shell. The call reports no result per pair; read them back with GetElementTrims. For a known result, use trimmingElement and call the command once per roof or shell.
-
trimming_element(ElementId | None, default:None) –Optional. The roof or shell that trims every element in the list, with trimType.
-
trim_type(None | TrimType, default:None) –Used with trimmingElement; defaults to KeepInside.
Returns:
unmerge_elements ¶
unmerge_elements(
element_pairs: list[ElementUnmergePair],
) -> list[
FailedExecutionResult | SuccessfulExecutionResult
]
Removes the merge between the two elements of each given pair. Undoable; one execution result per pair.
Parameters:
-
element_pairs(list[ElementUnmergePair]) –The pairs of merged elements to separate. The order within a pair does not matter.
Returns:
-
list[FailedExecutionResult | SuccessfulExecutionResult]–A list of execution results.
Related types¶
These include the parameter and result models used inside the client. The command signatures above show what to pass and what is returned.
CreateSolidElementLinksParametersCreateSolidElementLinksResultCreateSolidOperationsParametersCreateSolidOperationsResultGetElementTrimsParametersGetElementTrimsResultGetMergedElementsParametersGetMergedElementsResultGetSolidElementLinksParametersGetSolidElementLinksResultMergeElementsParametersRemoveElementTrimDirectionParametersRemoveElementTrimDirectionResultRemoveElementTrimsParametersRemoveElementTrimsResultRemoveSolidElementLinksParametersRemoveSolidElementLinksResultTrimElementsParametersUnmergeElementsParametersUnmergeElementsResultElementIdElementIdArrayItemElementTrimPairElementTrimsElementUnmergePairErrorItemExecutionResultFailedExecutionResultMergedElementsSolidLinkDataSolidLinkReferenceSolidLinksOfElementSolidOperationDataSolidOperationResultSuccessfulExecutionResultTrimType