Graphic Override¶
Read graphical override rules, create rules and combinations, and inspect override styles applied to elements.
Access this group through api.tapir.graphic_override.
Commands¶
No commands match. Try another name or clear the filter.
For exceptions shared by Unified API commands, see error handling.
create_graphical_override_combination ¶
create_graphical_override_combination(
name: str, rule_names: list[str]
) -> GuidId
Creates a graphic override combination from rule names, or replaces the rules of an existing one. Needs Archicad 27 or later.
Parameters:
-
name(str) –Name of the override combination. When a combination with this name exists, its rule list is replaced.
-
rule_names(list[str]) –Names of the override rules in the combination, in order. Rule names are unique in the project, whatever the rule group. An empty list makes a combination without rules.
Returns:
-
GuidId–The created or changed override combination.
create_graphical_override_rule ¶
create_graphical_override_rule(
name: str,
rule_group_name: None | str = None,
criterion_xml: None | str = None,
surface_rgb: ColorRGB | None = None,
line_pen_index: None | int = None,
override_contours: None | bool = None,
) -> GuidId
Creates or overwrites a graphic override rule in a rule group: name, criterion XML, surface color and line pen. Needs Archicad 27 or later.
Parameters:
-
name(str) –Name of the override rule. Rule names are unique in the project: an existing rule with this name is overwritten, in whichever rule group it is.
-
rule_group_name(None | str, default:None) –Rule group of a new rule, created when it does not exist. Default: 'Tapir'. An overwritten rule stays in its own group.
-
criterion_xml(None | str, default:None) –Optional criterion XML. Archicad only takes XML in its own format: read it from a rule made in the GUI with GetGraphicalOverrideRules and change the values. XML written from scratch is dropped without an error, and so is an empty one: the rule then applies to all elements.
-
surface_rgb(ColorRGB | None, default:None) –Optional color override of the cut and uncut surfaces. Components are in the 0..1 range.
-
line_pen_index(None | int, default:None) –Optional pen index override for lines, markers and texts. Only a positive index takes effect.
-
override_contours(None | bool, default:None) –Optional. If true, the contours of the overridden surfaces are recolored too.
Returns:
-
GuidId–The created or overwritten override rule.
get_graphical_override_rules ¶
get_graphical_override_rules() -> list[
GraphicalOverrideRuleDetails
]
Returns every graphic override rule with its criterion XML. Needs Archicad 27 or later.
Returns:
-
list[GraphicalOverrideRuleDetails]–
get_graphical_override_style_of_elements ¶
get_graphical_override_style_of_elements(
elements: list[ElementIdArrayItem],
) -> list[ErrorItem | GraphicalOverrideStyle]
Returns the graphic override style each element is drawn with in the current window: for every overridable member (line type, pens, fill types, surfaces, ...) whether the active graphic override combination replaces it, and with what. Needs Archicad 27 or later.
Parameters:
-
elements(list[ElementIdArrayItem]) –A list of elements.
Returns:
-
list[ErrorItem | GraphicalOverrideStyle]–The graphic override style of each element in the current window, aligned with the input, or an error.
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.
CreateGraphicalOverrideCombinationParametersCreateGraphicalOverrideCombinationResultCreateGraphicalOverrideRuleParametersCreateGraphicalOverrideRuleResultGetGraphicalOverrideRulesResultGetGraphicalOverrideStyleOfElementsParametersGetGraphicalOverrideStyleOfElementsResultColorRGBElementIdArrayItemErrorItemGraphicalOverrideRuleDetailsGraphicalOverrideStyleGuidId