Add [model manager]

Adds a model.

UI Access Tools > Edit Configured Libraries > Models > Add Model
Parameters
Name Type Description
<modelName> String Name of the model being added
<ModTime> Integer

An integer that corresponds to the number of seconds that have elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.

<Library> String Library name
<LibLocation> String Name of project and file path
<PinDefInfo> Array Optional, defines a model pins; multiple <PinDefInfo> arrays can be included; contents of the <PinDefInfo> array are detailed below.
<GraphicsDataInfo> Array

Optional, defines graphics. The array contains the following:

["NAME:Graphics",

# one or more of the following

<RectInfo>,

<CircleInfo>,

<ArcInfo>,

<LineInfo>,

<PolygonInfo>,

<TextInfo>,

<ImageInfo>]

The individual array attributes are detailed below.

<PropDisplayMapInfo> Array Optional, defines property displays; contents of the <PropDisplayMapInfo> are detailed below.
Return Value

Returns a string that includes composite name of the model. If the name requested conflicts with the name of an existing model, the requested name is altered to be unique, and the name returned reflects that alteration.

Details of the <PinDefInfo> array:

["NAME:PinDef",

"Pin:=", [<string>, # pin name

<real>, # x location

<real>, # y location

<real>, # angle in radians

<PinType>,

<real>, # line width

<real>, # line length

<bool>, # mirrored

<int>, # color

<bool>, # True if visible, False if not

<string>, # hidden net name

<OptionalPinInfo>, # optional info

<PropDisplayMapInfo>]] # optional

 

<PinType>:

<string> # "N" : normal pin

# "I" : input pin

# "O" : output pin

 

<OptionalPinInfo>:

# Specify both or neither

<bool>, # True if name is to be shown

<bool>, # True if number is to be shown

 

<PropDisplayMapInfo>:

["NAME:PropDisplayMap",

<PropDisplayInfo>,

<PropDisplayInfo>,...]

 

<PropDisplayInfo>:

<NameString>, [<DisplayTypeInfo>,

<DisplayLocationInfo>,

<int>, // optional, level number

<TextInfo>]

<NameString>:

<string> # PropertyName:=, where PropertyName is the name of the property to be displayed

 

<DisplayTypeInfo>:

<int> # 0 : No display

# 1 : Display name only

# 2 : Display value only

# 3 : Display both name and value

# 4: Display evaluated value only

# 5: Display both name and evaluated value

 

<DisplayLocationInfo>:

<int> # 0 : Left

# 1 : Top

# 2 : Right

# 3 : Bottom

# 4 : Center

# 5 : Custom placement

Details for arrays used in <GraphicsDataInfo>:

<RectInfo>:

"Rect:=", [<real>, # line width

<int>, # fill pattern

<int>, # color

<real>, # angle, in radians

<real>, # x position of center

<real>, # y position of center

<real>, # width

<real>] # height

 

<CircleInfo>:

"Circle:=", [<real>, # line width

<int>, # fill pattern

<int>, # color

<real>, # x position of center

<real>, # y position of center

<real>] # radius

 

<ArcInfo>:

"Arc:=", [<real>, # line width

<int>, # line pattern

<int>, # color

<real>, # x position of center

<real>, # y position of center

<real>, # radius

<real>, # start angle, in radians

<end>] # end angle, in radians

 

<LineInfo>:

"Line:=", [<real>, # line width

<int>, # line pattern

<int>, # color

<PointInfo>, # must specify at least 2 points

<PointInfo>...)

<PointInfo>:

<real>, # x position

<real>] # y position

 

<PolygonInfo>:

"Polygon:=", [<real>, # line width

<int>, # fill pattern

<int>, # color

<PointInfo>, # must specify at least 3 points

<PointInfo>...]

 

<TextInfo>:

"Text:=", [<real>, # x position

<real>, # y position

<real>, # angle, in radians

<Justification>,

<bool>, # is plotter font

<string>, # font name

<int>, # color

<string>] # text string

 

<Justification>:

<int> # 0 : left top

# 1 : left base

# 2 : left bottom

# 3 : center top

# 4 : center base

# 5 : center bottom

# 6 : right top

# 7 : right base

# 8 : right bottom

 

<ImageInfo>:

"Image:=", [<RectInfo>,

<ImageData>,

<bool>] # is mirrored

 

<ImageData>:

<string>, # file path

<int>, # 0 : use the file path and link to it

# 1 : ignore file path and use next parameter

<string> # text data, only present if preceding int is 1

Python Syntax

Add (["NAME:<modelName>",<ModTime>, "Library", "LibLocation",<PinDefInfo>,<GraphicsDataInfo>, <PropDisplayMapInfo>])

Python Example

oModelManager.Add(

["NAME:MyModel",

"ModTime:=", 1070989137,

"Library:=", "",

"LibLocation:=", "Project",

["NAME:PinDef",

"Pin:=", ["newpin0", 0.00254, 0, 0, "N",0, 0.00254, false, 0, true, "" ,false, false]

],

["NAME:PinDef",

"Pin:=", ["newpin1", -0.00254, 0, 3.14159265358979," N", 0, 0.00254, false, 0, true, "", false, false]

],

["NAME:Graphics",

"Rect:=", [0, 0, 12566272, 0, 4.33680868994202e-019, -0.000635,0.00508, 0.002794],

"Circle:=", [0, 0, 12566272, 0.000127, -0.000635, 0.000635]

]

])