Creating a Voltage Source
Add a global voltage source to Port1 for the default configuration, StandardConfiguration1.
myVoltageSource = myProject.Contents.SolutionConfigurations.GlobalSources:AddVoltageSource(myPort) myVoltageSource.Label = "Source1"
- A voltage source is a object and since there may be multiple objects in the model, it is part of the SourceCollection.
- Search for SourceCollection in the Help1.
-
In the Help, under
, search for methods that are applicable to voltage sources:
- AddVoltageSource (properties table)
- AddVoltageSource (portterminal Port)
To create a voltage source, we will use the method:AddVoltageSource(portterminal Port)
-
Fill in the port terminal (use port, Port1):
AddVoltageSource(Port1)
-
Determine the syntax to prepend to AddVoltageSource:
-
Add a reference to the newly created voltage source:
myVoltageSource = myProject.Contents.SolutionConfigurations.GlobalSources:AddVoltageSource(myPort)
-
Set the voltage source label to Source1:
myPatch.Label = "Source1"
Tip: View the VoltageSource (object) in the Help for a short example.