CreateComponent (Schematic Editor)

Creates a component of a given type.

UI Access N/A.
Parameters
Name Type Description
<params> Array Structured array.

Array("NAME:ComponentProps",

"Name:=", <String path to component in library>,

"Id:=", <String Component ID>)

<attributes> Array Structured array.

Array("NAME:Attributes",

"Page:=", <Integer: page number>,

Note:

For the page number, page 1 always exists.

"X:=", <Double: X position of object>,

"Y:=", <Double: Y position of the object>,

"Angle:=", <Double: rotation angle in degrees>,

"Flip:=", <boolean: True if mirrored; else False>,

"PinNumber:=", <Integer: index of pin in symbol 0 to n-1>

Note:

PinNumber is optional and is set to -1 by default. PinNumber affects where the symbol is placed relative to the X and Y parameters. If PinNumber is set to -1, the symbol is placed with its center at (X,Y). If it is a pin index, the symbol is placed so that the pin is located at (X,Y). The PinNumber is not recorded.

Return Value

String containing unique ID in the format:

CompInst@<CompName>;<compInstID>;<optional schematicID>

For example, the return value CompInst@CAP;4;35 indicates that the component name is CAP, its ID is 4, and its Schematic ID is 35.

You can also see these details in the Properties window when you select the created component.

 

Python Syntax CreateComponent(<params>, <attributes>)
Python Example

oEditor.CreateComponent(

["NAME:ComponentProps",

"Name:=", "Maxwell Circuit Elements\Passive Elements:Res",

"Id:=", "1"

],

["NAME:Attributes",

"Page:=", 1,

"X:=", -0.01524,

"Y:=", 0.00508,

"Angle:=", 0,

"Flip:=", false

]

)