Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fix delete port #5713

Merged
merged 12 commits into from
Feb 7, 2025
13 changes: 10 additions & 3 deletions src/ansys/aedt/core/hfss3dlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,14 +688,16 @@
else:
return False

@pyaedt_function_handler(portname="name")
def delete_port(self, name):
@pyaedt_function_handler(portname="name", remove_geometry=True)
amichel0205 marked this conversation as resolved.
Show resolved Hide resolved
def delete_port(self, name, remove_geometry=True):
"""Delete a port.

Parameters
----------
name : str
Name of the port.
remove_geometry : bool, optional
Whether to remove_geometry. The default is ``True``.
amichel0205 marked this conversation as resolved.
Show resolved Hide resolved

Returns
-------
Expand All @@ -705,8 +707,13 @@
References
----------
>>> oModule.Delete
>>> oModule.DeleteExcitations
"""
self.oexcitation.Delete(name)
if remove_geometry:
self.oexcitation.Delete(name)
else:
self.oexcitation.DeleteExcitation(name)

Check warning on line 715 in src/ansys/aedt/core/hfss3dlayout.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss3dlayout.py#L715

Added line #L715 was not covered by tests

for bound in self.boundaries:
if bound.name == name:
self.boundaries.remove(bound)
Expand Down
Loading