MaxwellCircuitComponents: create_component #4847
-
Hello, I can't seem to name a winding component using create_component(). For example: myWinding = MaxwellCircuitComponent.create_component(name="myWinding", component_library="", component_name="Winding") This creates the winding but does not set the name to "myWinding". Using myWinding.set_property(name="Name", value="myWinding") changes the name. Am I doing something wrong with create_component()? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @rickygill00, To create a winding you simply need this method: create_winding(). Hope this helps, Kind regards, Giulia |
Beta Was this translation helpful? Give feedback.
-
Hi @rickygill00 , Without a snippet of the code I can't know why this is failing but here are my two cents. As @gmalinve pointed out there are two things that you'll need to do, you need to create the winding and assign a name to it. Just to reiterate over what was said, you can go through the maxwell winding = circuit.modeler.create_component(
component_library="Dedicated Elements",
component_name="Winding",
location=[0,0],
angle=0,
page=("Page{}".format(1))
)
winding.set_property("Name", "Layer_1") Note that the name "Layer_" needs to match the name that you gave the Windings on the Maxwell Model. In this example the create component method will simply create a component Winding with a name LLayer_1 in Page 1 of the schematics at location 0,0. Please see https://examples.aedt.docs.pyansys.com/version/dev/examples/low_frequency/general/external_circuit.html#Finalize-external-circuit . It'll show you how to create components - not only winding but also sources. I hope this helps |
Beta Was this translation helpful? Give feedback.
Hi @rickygill00,
To create a winding you simply need this method: create_winding().
A usage example could be:
my_wdg = my_aedtapp.modeler.schematic.create_winding(name="wdg_name", location, angle use_instance_id_netlist=False)
This returns a CircuitComponent object where you could access several properties, one of which the composed_name.
To know which ones to access please do:
dir(my_wdg)
in your IDE.If you want to use the set_property() method try the following from the CircuitComponent object:
my_wdg.set_property("Name", new_name)
Hope this helps,
Kind regards,
Giulia