Assign port on circle sheet

Otty80
Otty80 Member Posts: 7
First Comment

Hi, i want to create a lumped port for a circle called "port" n pyaedt. I used this code for port creation:

int_line_start=["fx-r_ext","0","h_SMA"]

int_line_end=["fx","0","h_SMA"]


hfss.create_lumped_port_to_sheet("port", axisdir=[int_line_start, int_line_end], portname="1", reference_object_list=["coax_diel_ObjectFromFace1"])

I found the following error:

Port '1': Length of port lines must be greater than zero. (2:20:47 feb 04, 2023)


How to solve?

Thank you in advance

Tagged:

Comments

  • Samuel Lopez
    Samuel Lopez Member, Employee Posts: 20
    First Anniversary Ansys Employee 5 Likes First Answer

    Hi @Otty80 ,


    This method does not accept AEDT parameters in the axisdir, this could be improved, please submit an issue in Github if you want this feature in pyaedt. In the meanwhile, you could evaluate the value of the parameter before and pass it to the method. For example, if I have 2 parameters (a and b) that controls a sheet circle, you could:


    from pyaedt import constants
    
    a = constants.unit_converter(app.evaluate_expression("a"), "Length", 'meter', app.modeler.model_units)
    b = constants.unit_converter(app.evaluate_expression("b"), "Length", 'meter', app.modeler.model_units)
    
    port = app.create_lumped_port_to_sheet(sheet_name="port",
                                    axisdir=[[-a/2, -b, 0], [-a/2, 0, 0]],
                                    impedance=50,
                                    portname="p1"
                                    )
    

    Please let me know if it works in your case.

  • Samuel Lopez
    Samuel Lopez Member, Employee Posts: 20
    First Anniversary Ansys Employee 5 Likes First Answer

    Please add a tag for a future search of this question: PyAEDT and AEDT should be enough for the tag. Thanks.

  • Otty80
    Otty80 Member Posts: 7
    First Comment
    edited March 2023

    ok

  • Otty80
    Otty80 Member Posts: 7
    First Comment