[S8436] Script to acquire set value information for [Current Source (1 Terminal)] and [Electric Potential Source (1 Terminal)].

 

I want to get the setting value information of [Current Source (1 Terminal)] or [Electric Potential Source (1 Terminal)] by a script.

The following is an example of a Python script to obtain the configuration information of [Current Source (1 Terminal)].
# -*- coding: utf-8 -*-

app = designer.GetApplication()

#Registration of an object variable specifying the circuit element name "Ia".

Ia = app.GetModel(0).GetStudy(0).GetCircuit().GetComponent(u"Ia")

#Obtaining and displaying configuration information.

print(u"name: ",Ia.GetName())

print(u"XType: ",Ia.GetStringValue(u"XType"),u" *Flag Value")

print(u"Type: ",Ia.GetStringValue(u"FunctionType"),u" *Flag Value")

print(u"FunctionType: ",Ia.GetFunction().GetType())

print(u"Amplitude: ",Ia.GetFunction().GetValue(u"Amplitude"))

print(u"Frequency: ",Ia.GetFunction().GetValue(u"Frequency"))

print(u"Phase: ",Ia.GetFunction().GetValue(u"Phase"))
The following is an example of a Python script to obtain the configuration information of [Electric Potential Source (1 Terminal)].
# -*- coding: utf-8 -*-

app = designer.GetApplication()

#Registration of an object variable specifying the circuit element name "V1".

V1 = app.GetModel(0).GetStudy(0).GetCircuit().GetComponent(u"V1")

#Obtaining and displaying configuration information.

print(u"name: ",V1.GetName())

print(u"XType: ",V1.GetStringValue(u"XType"),u" *Flag Value")

print(u"Type: ",V1.GetStringValue(u"FunctionType"),u" *Flag Value")

print(u"FunctionType: ",V1.GetFunction().GetType())

print(u"Amplitude: ",V1.GetFunction().GetValue(u"Amplitude"))

print(u"Frequency: ",V1.GetFunction().GetValue(u"Frequency"))

print(u"Phase: ",V1.GetFunction().GetValue(u"Phase"))
*Note

 - Information that can be obtained at the time of acquisition exists in some cases other than the above example.

 - If the name of a circuit element is duplicated, the information of the first created circuit element is acquired.

   In such a case, please change to ID designation instead of name designation.

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.

Search Filter

  • All Categories

An engineer's diary
JMAG-Express Online