create_placeholder#
- TcpOslServer.create_placeholder(value: Any | None = None, placeholder_id: str | None = None, overwrite: bool = False, user_level: UserLevel | None = None, description: str | None = None, range_: str | None = None, type_: PlaceholderType | None = None, expression: str | None = None) str#
Create a new placeholder.
Note
Method is supported for Ansys optiSLang version >= 26.1 only.
- Parameters:
- value
Optional[Any],optional Value for the placeholder, by default
None. If neither value nor expression are specified, the placeholder will be created with a suitable default value. If specified, the value must be of a type compatible with the placeholder type.- placeholder_id
Optional[str],optional Desired placeholder ID, by default
None. If not specified, a unique ID will be generated.- overwritebool,
optional Whether to overwrite existing placeholder, by default
False.- user_level
Optional[UserLevel],optional User level for the placeholder, by default
None. If not specified, the default user level will be used.- description
Optional[str],optional Description of the placeholder, by default
None.- range_
Optional[str],optional Range of the placeholder, by default
None.- type_
Optional[PlaceholderType],optional Type of the placeholder, by default
None. If not specified, the UNKNOWN type will be used.- expression
Optional[str],optional Macro expression for the placeholder, by default
None.
- value
- Returns:
strID of the created placeholder.
- Raises:
OslCommunicationErrorRaised when an error occurs while communicating with server.
OslCommandErrorRaised when the command or query fails.
TimeoutErrorRaised when the timeout float value expires.