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

FEAT: get the path of a circuit component #5598

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,23 @@
except Exception:
return False

@pyaedt_function_handler()
def component_path(self, component_name):
"""Component definition path.
Parameters
----------
component_name: str
Name of the component.
"""
for component in self.components.values():
if component.component_info["InstanceName"] == component_name:
component_definition = component.component_info["Info"]
if not self.o_component_manager.GetData(component_definition):
self.logger.warning("Component has no path")
return False

Check warning on line 1255 in src/ansys/aedt/core/modeler/circuits/primitives_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_circuit.py#L1250-L1255

Added lines #L1250 - L1255 were not covered by tests
else:
return (self.o_component_manager.GetData(component_definition)[24][1][12][1].split(" ")[1])[1:-1]

Check warning on line 1257 in src/ansys/aedt/core/modeler/circuits/primitives_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_circuit.py#L1257

Added line #L1257 was not covered by tests
gkorompi marked this conversation as resolved.
Show resolved Hide resolved


class ComponentInfo(object):
"""Manages Circuit Catalog info."""
Expand Down
Loading