ScrPlaceCircuitElement

Attaches a circuit element of the specified type to the design.

The element can be connected between any two points, pins or pin groups.

UI Command:   Home > Circuit Elements > Add [Capacitor / Inductor / Resistor / Port / Voltage Probe / Voltage Source / Current Source].
Syntax:   obj.ScrPlaceCircuitElement(<givenElementName>, <givenPartName>, <circuitElementType>, <posTermConnectionType>, <posTermParam1>, <posTermParam2>, <posTermParam3>, <refTermConnectionType>, <refTermParam1>, <refTermParam2>, <refTermParam3>, <capVal>, <indVal>, <resVal>, <refZRe>, <mag>, <phase>)
Parameters:  

BSTR givenElementName (name of circuit element to be created)

BSTR givenPartName (part name of circuit element to be created)

INT circuitElementType (0 = capacitor; 1 = inductor; 2 = resistor; 3 = port; 4 = current source; 5 = voltage source; 6 = voltage probe)

INTposTermConnectionType (0 = attachment to PIN; 1 = attachment to PIN GROUP; 2 = attachment at COORDINATES)

BSTR posTermParam1 (partName or x)

BSTR posTermParam2 (refDes or y)

BSTR posTermParam3 (pinName, groupName, or layerName)

INT refTermConnectionType (0 = attachment to PIN; 1 = attachment to PIN GROUP; 2 = attachment at COORDINATES)

BSTR refTermParam1 (partName or x)

BSTR refTermParam2 (refDes or y)

BSTR refTermParam3 (pinName, groupName, or layerName)

double capVal (capacitance)

double indVal (inductance)

double resVal (resistance)

double refZRe (impedance)

double mag (magnitude)

double phase (phase)

 

Use an empty string for any parameters that are not applicable.

Return Value:  

BOOL:

  • 0 – Failure
  • 1 – Success
VB Example:  

' outcome is set to TRUE on success

' Create a Capacitor:

outcome = obj.ScrPlaceCircuitElement "cap_1", "cap_part", 0, 1, "100354431", "Q3", "pinGrp_4", 1, "100349132", "U26", "pinGroup_10", 4.7e-9, 2e-11, 3e-3, 0.0, 0.0, 0.0

' Create a Resistor:

outcome = obj.ScrPlaceCircuitElement "res_1", "res_part", 2, 0, "100354431", "Q3", "2_1", 0, "100349132", "U26", "HS_1", 50.0, 0.0, 0.0, 0.0, 0.0, 0.0

' Create a Voltage Source:

outcome = obj.ScrPlaceCircuitElement "vs_1", "vs_part", 5, 0, "100354431", "Q3", "2_1", 0, "100349132", "U26", "HS_1", 0.0, 0.0, 5e-6, 0.0, 3.0, 180.0

IPY Example:  

oDoc.ScrPlaceCircuitElement ('cap_1', 'cap_part', 0, 1, '100354431', 'Q3', 'pinGrp_4', 1, '100349132', 'U26', 'pinGroup_10', 4.7e-9, 2e-11, 3e-3, 0.0, 0.0, 0.0)