CreatePolygon (Schematic Editor)

Create a polygon

UI Access Draw>Primitive>Polygon
Parameters
Name Type Description
<PolygonData> Array

Array("NAME:PolygonData" _

"Points:=", Array of points, _

"LineWidth:=", double, // the width of the Polygon 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 Polygon 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

Polygon 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 polygon.

 

Python Syntax CreatePolygon()
Python Example

oEditor.CreatePolygon(

["NAME:PolygonData", "Points:=", [ _

"(-0.058951, 0.006308)", "(-0.046142, 0.010480)",_

"(-0.046239, 0.001067)"), "LineWidth:=", _

0, "BorderColor:=", 0, "Fill:=", 0, "Color:=",_

0, "Id:=", 27], ["NAME:Attributes", "Page:=", 1]])

 

VB Syntax CreatePolygon()
VB Example

oEditor.CreatePolygon

Array("NAME:PolygonData", "Points:=", Array( _

"(-0.058951, 0.006308)", "(-0.046142, 0.010480)",_

"(-0.046239, 0.001067)"), "LineWidth:=", _

0, "BorderColor:=", 0, "Fill:=", 0, "Color:=",_

0, "Id:=", 27), 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")

polygonID = oEditor.CreatePolygon(Array("NAME:PolygonData", "Points:=", Array( _

"(0.101600, 0.058420)", "(0.101600, 0.060960)", "(0.101600, 0.058420)", _

"(0.099060, 0.060960)", "(0.101600, 0.060960)", "(0.101600, 0.058420)", _

"(0.101600, 0.060960)", "(0.101600, 0.060960)"), "LineWidth:=", 0, "BorderColor:=", _

0, "Fill:=", 0, "Color:=", 0, "Id:=", 218), Array("NAME:Attributes", "Page:=", 1))

MsgBox "Polygon ID = " & polygonID