at.lattice.lattice_parameterise#
Functions
|
Checks if any of the selected elements is parameterised. |
|
Convert an attribute of the selected elements into a parameter. |
|
Set a parameter as an attribute of the selected elements. |
|
Freeze the value of attributes of the selected elements. |
- is_parameterised(self, refpts=RefptsCode.All, attrname=None, index=None)[source]#
Checks if any of the selected elements is parameterised.
This method evaluates whether any of the elements within the specified reference points are parameterised based on the provided attribute name and index. It iterates over the selected elements and checks their parameterisation status. The function returns True if at least one element is parameterised; otherwise, it returns False.
- Parameters:
refpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Element selector. The default value is All, which includes all elements.
attrname (str | None) – Name of the attribute to check. If
None, all the attributes are checked.index (int | None) – Index in an array. If
None, the whole attribute is checked
- Returns:
bool – True if any of the selected elements is parameterised, False
otherwise.
- parameterise(self, refpts, attrname, index=None, name='')[source]#
Convert an attribute of the selected elements into a parameter.
A single parameter is created and assigned to all the selected elements. Its initial value is the mean of the original values.
- Parameters:
refpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Element selector. The default value is All, which includes all elements.
attrname (str) – Name of the attribute to parameterise.
index (int | None) – Index into an array attribute. If value is a parameter, the attribute is converted to a
ParamArray.name (str) – Name of the created parameter
- Returns:
param – The created parameter
- set_parameter(self, refpts, attrname, value, index=None)[source]#
Set a parameter as an attribute of the selected elements.
- Parameters:
refpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Element selector
attrname (str) – Attribute name
value (Any) – Parameter or value to be set
index (int | None) – Index into an array attribute. If value is a parameter, the attribute is converted to a
ParamArray.
- unparameterise(self, refpts=RefptsCode.All, attrname=None, index=None)[source]#
Freeze the value of attributes of the selected elements.
- Parameters:
refpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Element selector. The default value is All, which includes all elements.
attrname (str | None) – Attribute name. If
None, all the attributes are frozenindex (int | None) – Index in an array. If
None, the whole attribute is frozen