Skip to content

Commit e590c51

Browse files
FEATURE: Add PadstackDefData.GetConnectionPt() PadstackDefData.SetConnectionPt() API
1 parent fc72907 commit e590c51

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

src/ansys/edb/core/definition/padstack_def_data.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,20 @@ def padstack_def_data_set_solder_ball_param_message(target, d1, d2):
146146
def padstack_def_data_set_solder_ball_material_message(target, material):
147147
return pb.PadstackDefDataSetSolderBallMaterialMessage(target=target.msg, material=material)
148148

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, x, y, direction):
155+
return pb.PadstackDefDataSetConnectionPtMessage(
156+
target=target.msg,
157+
layer=layer,
158+
x=messages.value_message(x),
159+
y=messages.value_message(y),
160+
direction=direction.value,
161+
)
162+
149163

150164
class PadType(Enum):
151165
"""Provides an enum representing pad types."""
@@ -202,6 +216,22 @@ class SolderballPlacement(Enum):
202216
UNKNOWN_PLACEMENT = pb.UNKNOWN_PLACEMENT
203217

204218

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+
205235
class PadstackDefData(ObjBase):
206236
"""Represents a padstack data definition."""
207237

@@ -473,3 +503,47 @@ def solder_ball_material(self, material):
473503
self, material
474504
)
475505
)
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, x, y, direction):
531+
"""
532+
Set connection point position and direction.
533+
534+
Parameters
535+
----------
536+
layer : str
537+
Layer name.
538+
x : :class:`Value <ansys.edb.core.utility.Value>`
539+
X.
540+
y : :class:`Value <ansys.edb.core.utility.Value>`
541+
Y.
542+
direction : :class:`ConnectionPtDirection`
543+
Direction.
544+
"""
545+
self.__stub.SetConnectionPt(
546+
_PadstackDefDataQueryBuilder.padstack_def_data_set_connection_pt_message(
547+
self, layer, x, y, direction
548+
)
549+
)

0 commit comments

Comments
 (0)