ansys.scade.apitools.create.declaration.create_constant#
- ansys.scade.apitools.create.declaration.create_constant(owner: scade.model.suite.Package, name: str, type_: ansys.scade.apitools.create.type.TX, value: ansys.scade.apitools.create.expression.EX, path: pathlib.Path | None = None, visibility: VK = VK.PUBLIC) scade.model.suite.Constant #
Create a constant.
A constant has a name, type, and value.
Parameters#
- ownersuite.Package
Owner of the constant, which is either the model itself or a package.
- namestr
Name of the constant.
- type_TX
Definition of the type expressed as a type tree.
- valueEX
Expression tree defining the value.
- pathPath | None, default: None
Path of the file for storing the constant. This parameter is ignored if the owner is a package. When the path is
None
and owner is the model, theconstant is stored in the model’s default file.- visibilityVK
Accessibility of the constant.
Returns#
suite.Constant