create_placeholder#

abstractmethod Project.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 placeholder.

Note

Method is supported for Ansys optiSLang version >= 26.1 only.

Parameters:
valueOptional[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_idOptional[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_levelOptional[UserLevel], optional

User level for the placeholder, by default None. If not specified, the default user level will be used.

descriptionOptional[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.

expressionOptional[str], optional

Macro expression for the placeholder, by default None.

Returns:
str

ID of the created placeholder.

Raises:
OslCommunicationError

Raised when an error occurs while communicating with server.

OslCommandError

Raised when the command or query fails.

TimeoutError

Raised when the timeout float value expires.