CreateRectangle (Schematic Editor)

Create a rectangle

UI Access Draw>Primitive>Rectangle
Parameters
Name Type Description
<RectData> Array

Array("NAME:RectData" _

"x1:=", double, _ // X position of the upper left

"y1:=", double, _ // Y position of the upper left

"x2:=", double, _ // X position of the lower right

"y2:=", double",_ // Y position of the lower right

"LineWidth:=", double, // the width of the Rectangle border, in meters

"Bordercolor:=", int, // the RBG value of the border color

"Fill:=", int, // the fill pattern id, 0 = hollow, 1 = solid, 2 = NEDiagonal,

3 = OrthoCross, 4 = DiagCross, 5 = NWDiagonal, 6 = Horizontal, 7 = Vertical

"Color:=", int, // the RBG value of the Rectangle fill color

"Id:=", int), // [Opt=New id] Id for this item

<Attributes> Array

Array("NAME:Attributes", _

"Page:=", int) _ // [Opt=1] Page number (one-based)

[out,retval] string id)

Return Value String

Unique id

Rectangle is created and the return value has the format

SchObj@<schematicID>

The Schematic ID can be found in the Properties window on the Symbol tab when you select the rectangle.

 

Python Syntax CreateRectangle()
Python Example

oEditor.CreateRectangle

(["NAME:RectData", "X1:=", -0.0755449856733525, "Y1:=", _

0.0335755491881566, "X2:=", -0.0611831900668577, "Y2:=", _

0.0254242597898758, "LineWidth:=", _

0, "BorderColor:=", 0, "Fill:=", 0, "Color:=", 0, "Id:=", 31], _

["NAME:Attributes", "Page:=", 1])

 

VB Syntax CreateRectangle()
VB Example

oEditor.CreateRectangle

Array("NAME:RectData", "X1:=", -0.0755449856733525, "Y1:=", _

0.0335755491881566, "X2:=", -0.0611831900668577, "Y2:=", _

0.0254242597898758, "LineWidth:=", _

0, "BorderColor:=", 0, "Fill:=", 0, "Color:=", 0, "Id:=", 31), _

Array("NAME:Attributes", "Page:=", 1)

 

VB Example:

Dim oAnsoftApp

Dim oDesktop

Dim oProject

Dim oDesign

Dim oEditor

Dim oModule

Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")

Set oDesktop = oAnsoftApp.GetAppDesktop()

oDesktop.RestoreWindow

Set oProject = oDesktop.SetActiveProject("Project4")

Set oDesign = oProject.SetActiveDesign("Circuit1")

Set oEditor = oDesign.SetActiveEditor("SchematicEditor")

rectangleID = oEditor.CreateRectangle(Array("NAME:RectData", "X1:=", 0.1016, "Y1:=", 0.0635, "X2:=", _

0.10414, "Y2:=", 0.06096, "LineWidth:=", 0, "BorderColor:=", 0, "Fill:=", 0, "Color:=", _

0, "Id:=", 9), Array("NAME:Attributes", "Page:=", 1))

MsgBox "Rectangle ID = " & rectangleID