|
11 | 11 |
|
12 | 12 | from ansys.edb.core.inner import ObjBase, messages, parser
|
13 | 13 | from ansys.edb.core.session import StubAccessor, StubType
|
14 |
| -from ansys.edb.core.utility import Value |
| 14 | +from ansys.edb.core.utility import Value, conversions |
15 | 15 |
|
16 | 16 |
|
17 | 17 | class _PadstackDefDataQueryBuilder:
|
@@ -146,6 +146,20 @@ def padstack_def_data_set_solder_ball_param_message(target, d1, d2):
|
146 | 146 | def padstack_def_data_set_solder_ball_material_message(target, material):
|
147 | 147 | return pb.PadstackDefDataSetSolderBallMaterialMessage(target=target.msg, material=material)
|
148 | 148 |
|
| 149 | + @staticmethod |
| 150 | + def padstack_def_data_get_connection_pt_message(target, layer): |
| 151 | + return pb.PadstackDefDataGetConnectionPtMessage(target=target.msg, layer=layer) |
| 152 | + |
| 153 | + @staticmethod |
| 154 | + def padstack_def_data_set_connection_pt_message(target, layer, position, direction): |
| 155 | + return pb.PadstackDefDataSetConnectionPtMessage( |
| 156 | + target=target.msg, |
| 157 | + layer=layer, |
| 158 | + x=messages.value_message(position.x), |
| 159 | + y=messages.value_message(position.y), |
| 160 | + direction=direction.value, |
| 161 | + ) |
| 162 | + |
149 | 163 |
|
150 | 164 | class PadType(Enum):
|
151 | 165 | """Provides an enum representing pad types."""
|
@@ -202,6 +216,22 @@ class SolderballPlacement(Enum):
|
202 | 216 | UNKNOWN_PLACEMENT = pb.UNKNOWN_PLACEMENT
|
203 | 217 |
|
204 | 218 |
|
| 219 | +class ConnectionPtDirection(Enum): |
| 220 | + """Provides an enum representing connection pt direction.""" |
| 221 | + |
| 222 | + PS_NO_DIRECTION = pb.PS_NO_DIRECTION |
| 223 | + PS_ANY_DIRECTION = pb.PS_ANY_DIRECTION |
| 224 | + PS_0_DIRECTION = pb.PS_0_DIRECTION |
| 225 | + PS_45_DIRECTION = pb.PS_45_DIRECTION |
| 226 | + PS_90_DIRECTION = pb.PS_90_DIRECTION |
| 227 | + PS_135_DIRECTION = pb.PS_135_DIRECTION |
| 228 | + PS_180_DIRECTION = pb.PS_180_DIRECTION |
| 229 | + PS_225_DIRECTION = pb.PS_225_DIRECTION |
| 230 | + PS_270_DIRECTION = pb.PS_270_DIRECTION |
| 231 | + PS_315_DIRECTION = pb.PS_315_DIRECTION |
| 232 | + PS_UNKNOWN_DIRECTION = pb.PS_UNKNOWN_DIRECTION |
| 233 | + |
| 234 | + |
205 | 235 | class PadstackDefData(ObjBase):
|
206 | 236 | """Represents a padstack data definition."""
|
207 | 237 |
|
@@ -473,3 +503,45 @@ def solder_ball_material(self, material):
|
473 | 503 | self, material
|
474 | 504 | )
|
475 | 505 | )
|
| 506 | + |
| 507 | + def get_connection_pt(self, layer): |
| 508 | + """ |
| 509 | + Get connection point position and direction by layer name. |
| 510 | +
|
| 511 | + Parameters |
| 512 | + ---------- |
| 513 | + layer : str |
| 514 | + Layer name. |
| 515 | +
|
| 516 | + Returns |
| 517 | + ------- |
| 518 | + tuple[:class:`geometry.PointData`, :class:`ConnectionPtDirection`] |
| 519 | +
|
| 520 | + The tuple is in a ``(position, direction)`` format: |
| 521 | +
|
| 522 | + - ``position``: Position of the connection point. |
| 523 | + - ``direction``: Direction of the connection point. |
| 524 | + """ |
| 525 | + msg = self.__stub.GetConnectionPt( |
| 526 | + _PadstackDefDataQueryBuilder.padstack_def_data_get_connection_pt_message(self, layer) |
| 527 | + ) |
| 528 | + return parser.to_point_data(msg), ConnectionPtDirection(msg.direction) |
| 529 | + |
| 530 | + def set_connection_pt(self, layer, position, direction): |
| 531 | + """ |
| 532 | + Set connection point position and direction. |
| 533 | +
|
| 534 | + Parameters |
| 535 | + ---------- |
| 536 | + layer : str |
| 537 | + Layer name. |
| 538 | + position : ansys.edb.core.typing.PointLike |
| 539 | + Position. |
| 540 | + direction : :class:`ConnectionPtDirection` |
| 541 | + Direction. |
| 542 | + """ |
| 543 | + self.__stub.SetConnectionPt( |
| 544 | + _PadstackDefDataQueryBuilder.padstack_def_data_set_connection_pt_message( |
| 545 | + self, layer, conversions.to_point(position), direction |
| 546 | + ) |
| 547 | + ) |
0 commit comments