Rectangle#
- class pyedb.grpc.database.primitive.rectangle.Rectangle(pedb, edb_object=None)#
Bases:
ansys.edb.core.primitive.rectangle.Rectangle,pyedb.grpc.database.primitive.primitive.PrimitiveClass representing a rectangle object.
Overview#
Create a rectangle primitive in the specified layout, layer, and net with the given parameters. |
|
Delete the rectangle primitive from the layout. |
|
Get coordinates parameters. |
|
Set coordinates parameters. |
PolygonData. |
|
Representation type. |
Import detail#
from pyedb.grpc.database.primitive.rectangle import Rectangle
Property detail#
- property Rectangle.polygon_data#
PolygonData.
- Returns:
PolygonData
Method detail#
- Rectangle.create(layout=None, layer: str | pyedb.grpc.database.layers.layer.Layer = None, net: str | Net = None, rep_type: str = 'center_width_height', param1: float = None, param2: float = None, param3: float = None, param4: float = None, corner_rad: float = 0.0, rotation: float = 0.0)#
Create a rectangle primitive in the specified layout, layer, and net with the given parameters.
- Parameters:
- layout
Layout,optional The layout in which the rectangle will be created. If not provided, the active layout of the pedb instance will be used.
- layer
Union[str,Layer],optional The layer in which the rectangle will be created. This parameter is required and must be specified.
- net
Union[str,Net],optional The net to which the rectangle will belong. This parameter is required and must be specified.
- rep_type
str,optional The representation type of the rectangle. Options are “center_width_height” or “lower_left_upper_right”. The default value is “center_width_height”.
- param1
float,optional The first parameter defining the rectangle. Its meaning depends on the rep_type.
- param2
float,optional The second parameter defining the rectangle. Its meaning depends on the rep_type.
- param3
float,optional The third parameter defining the rectangle. Its meaning depends on the rep_type.
- param4
float,optional The fourth parameter defining the rectangle. Its meaning depends on the rep_type.
- corner_rad
float,optional The corner radius of the rectangle. The default value is 0.0.
- rotation
float,optional The rotation angle of the rectangle in degrees. The default value is 0.0.
- layout
- Returns:
RectangleThe created rectangle primitive.
- Raises:
ValueErrorIf the layer parameter is not provided.
ValueErrorIf the net parameter is not provided.
Notes
The created rectangle is added to the modeler primitives of the pedb instance.
- The rep_type determines how the parameters are interpreted:
“center_width_height”: param1 and param2 represent the center coordinates, while param3 and
param4 represent the width and height. - “lower_left_upper_right”: param1 and param2 represent the lower-left corner coordinates, while param3 and param4 represent the upper-right corner coordinates.
- Rectangle.delete()#
Delete the rectangle primitive from the layout.
- Rectangle.get_parameters()#
Get coordinates parameters.
- Returns:
tuple[str, float, float, float, float, float, float`
- ]
Returns a tuple of the following format:
(representation_type, parameter1, parameter2, parameter3, parameter4, corner_radius, rotation)
representation_type : Type that defines given parameters meaning.
parameter1 : X value of lower left point or center point.
parameter2 : Y value of lower left point or center point.
parameter3 : X value of upper right point or width.
parameter4 : Y value of upper right point or height.
corner_radius : Corner radius.
rotation : Rotation.
- Rectangle.set_parameters(rep_type, param1, param2, param3, param4, corner_rad, rotation)#
Set coordinates parameters.
- Parameters:
- rep_type
RectangleRepresentationType Type that defines given parameters meaning.
- param1
Value X value of lower left point or center point.
- param2
Value Y value of lower left point or center point.
- param3
Value X value of upper right point or width.
- param4
Value Y value of upper right point or height.
- corner_rad
Value Corner radius.
- rotation
Value Rotation.
- rep_type