ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
197 stars 116 forks source link

In HFSS3d Layout add a function to be able to change the "Boundary Type" property of a Port and the "Boundary definition" (R Enabled, L Enabled, C Enabled) and values. #3251

Closed Ouam74 closed 3 months ago

Ouam74 commented 1 year ago

Description of the feature

Dear colleagues,

In a "HFSS3DLayout" project, I select 2 pins of a component, then i perform a right click and select "Create". This creates a port (a sheet) between the 2 pins. The problem now is that i need to change the "Boundary Type" property from Port to RLC. Then i need to activate R, L or C and to assign the component value.

I can currently do it using IronPython :

Change Boundary type : h3d.odesign.ChangeProperty(["NAME:AllTabs", ["NAME:EM Design", ["NAME:PropServers", "Excitations:Port%d" %i], ["NAME:ChangedProps", ["NAME:Boundary Type", "Value:=", "RLC"]]]])

Activate R, L or C : h3d.odesign.ChangeProperty(["NAME:AllTabs", ["NAME:EM Design", ["NAME:PropServers", "Boundaries:Port%d" % i], ["NAME:ChangedProps", ["NAME:R Enabled", "Value:=", True]]]])

Assign a value to R, L or C: h3d.odesign.ChangeProperty(["NAME:AllTabs", ["NAME:EM Design", ["NAME:PropServers", "Boundaries:Port%d" % i], ["NAME:ChangedProps", ["NAME:R", "Value:=", "%s" %components[cmp].model.res]]]])

but it's not very elegant...

Thank you ! Olivier.

Steps for implementing the feature

No response

Useful links and references

No response

Samuelopez-ansys commented 3 months ago

With this PR https://github.com/ansys/pyaedt/pull/4684

It will possible to change Port to a boundary:

If aedtapp.boundaries[0] is the Port1 for instance:

aedtapp.boundaries[0].object_properties.props["Boundary Type"] = "RLC" aedtapp.boundaries[0].object_properties.props["R Enabled"] = True aedtapp.boundaries[0].object_properties.props["R"] = "100ohm"