LET - v14
let <nvar> = <n> | <vector>
or
let <svar> = <str> | <function>
or
let <pvar> = <vector> | C |<function>
or
let DATA( <nvar> | <svar> | <pvar> {,<file>} )
= ( <n> | <str> | <vector> )
let <nvar> = <n> | <vector>
Function
Give a value to one of the program numeric variables. The command word LET may be omitted.
Parameters
|
nvar
|
The numeric variable to be given a value.
|
|
|
|
|
n
|
A numeric expression comprising any combination of numeric variables, numeric constants, functions, and special constants yielding a numeric file using operators (+ - * / **) and/or round parentheses. The available functions are as follows:
|
|
|
abs(<n>)
positive value of <n>
acos(<n>)
arc-cosine of <n>
ang(<vector>,<vector>)
plan angle between two 3-D points
ang3(<vector>,<vector>,<vector>)
angle in 3-D between two lines
asin(<n>)
arc-sine of <n>
atan(<n>)
arc-tangent of <n>
col(<i>)
the colours in pen <i>. Three values are returned: the red, green and blue constituents
If -1 is passed to the function then the top-background color (COL H…) is returned.
cos(<n>)
cosine of <n>
cpos (svar,<text>)
character position of "text" within string SVAR.
data(<nvar>{,<file>})
value of the numeric variable NVAR from a Design Data File
decl(<var>)
status of variable <var>. Returned values are
0 if <var> is not defined,
1 if <var> is defined as a numeric,
2 if <var> is defined as a point,
3 if <var> is defined as a string,
4 if <var> is defined as a numeric array,
5 if <var> is defined as a point array,
6 if <var> is defined as a string array.
dist(<vector>,<vector>)
distance between two 3-D points
dot(<vector>,<vector>)
dot product of two 3-D points
exp(<n>)
exponent, e raised to a power
frag(<i>)
status of fragment <i>. Two values are given: its
visibility and treatability (0 is off, 1 is on)
hang(<vector>,<vector>)
elevation angle between two 3-D points
inf(<i>)
model information in the form of one or more scalar values. The parameter <i> indicates which information is being requested about the currently selected item. Information available is outlined in the section: "Model Function Information".
infi(<i>)
model information similar to INF but about the last identified item rather than the currently selected item
hint(<i>)
nearest integer value of <i> rounding up
infogui(<i>)
Is a numeric function that returns the list of the active toolbar and dialog panels in the order that they are at the moment of the execution of this INFOGUI function.
<i>=0 returns list of active panels
<i>=-1 returns 1 if MenuBar is installed
<i>=<id> returns list of active panels associated with the gwindow denoted by the identifier <id>
If the function values is greater than 0 the information returned refers to specific panels attached to specific GWINDOWs.
The "Order" means anti-clockwise from top toolbar:
|
|
|
|
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
4
|
5
|
6
|
|
12
|
11
|
10
|
|
|
|
|
9
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
7
|
|
|
|
supposing panels from 1 to 12 were mounted as toolbars and docked dialogs. Complimented with the INFOPANEL function below, this function helps to make the user interface persistent and enables it to be recreated at the next session of the application.
Example: v1=infogui(0)
stores in V1,V2, ..., Vm the id of the M active toolbars and dialogs ordered as described above.
infopanel<i>
Update 12.2.0 Where <i> is the panel_id. A numeric function to retrieve information about a PANEL, such as:
V1=INFOPANEL(PANEL_ID)
V1 - 0 if the panel does not exists
1 if the panel exists and is open
2 if the panel exists and is closed
V2 - the PIN= value
V3 - the ATT= value
V4 - the x position in pixels
V5 - the y position in pixels
V6 - 1 if the panel or toolbar is locked or 0 if otherwise defined.
V7 - the width of the panel in pixels
V7 - the length of the panel in pixels
int(<i>)
truncated integer value of <i>
isnum(svar)
a numeric function (ISNUM) to allow checking if the value of a string is a numeric value or not.
The usage of the function is:
V1=ISNUM(S1)
V1=ISNUM(‘123.456’)
Update 11.7.3 b02
len(svar)
length of string variable SVAR
lig(<i>)
status of the light source i. Returned values are 1, light source is on, 2 light source is off.
log(<n>)
natural logarithm, to the base e
logx(<n>)
common logarithm, to the base 10
max(<nvar1>,<nvar2>.)
or
max(<n_range>)
maximum value of nvar1, nvar2, etc.
min(<nvar1>,<nvar2>.)
or
min(<n_range>)
minimum value of nvar1, nvar2, etc.
nint(<i>)
rounded integer value of <i>
norm(<vector>,<vector>,<vector>)
equation of a plane defined by three 3-D points. Four values will be returned: a,b,c,d in the equation ax + by + cz = d
nval(<nvar1>,<nvar2>)
the value of nvar1 rounded to the nearest multiple of nvar2
onit(<vector>,<vector>,<vector>)
whether and where a point (first vector phrase) lies along a line (2nd and 3rd). Two values are returned: whether the point lies on the line (1 or 0), and where on the line the point lies as a factor of the line length.
panel(<i>,<j>)
External custom controls can be added to standard Eagle panels (mixed mode). This is enabled by a numeric function for called PANEL(<i>,<j>), which returns the windows handle of the panel <i> or of the button <j> defined in the panel <i>. Update 11.9.4 b01
rand(<n>)
random number between 0 and <n>
rem(<nvar1>,<nvar2>)
the remainder when nvar1 is divided by nvar2
sin(<n>)
sine of <n>
sqrt(<n>)
square root of <n>
stat(<i>)
status of state <i>. Returned values are 1 state is defined, 2 state is not defined.
sys(<i>)
returns system information in the form of one or more scalar values. The <i> parameter indicates what system information is being requested. The possible system information items are outlined in the System Function Information section.
tan(<n>)
tangent of <n>
weas(<i>)
state of weasel n. Returned values are
-1 end-of-file
0 no data waiting
1 data waiting
5 weasels may be active at the same time.
The special constants are as follows:
m the current pen number
t the current line thickness
vb the number of the last puck button pressed
v the current view
$ the current dash pattern number
pi the value of pi
% the percentage of available memory used by the current Eagle model see DEFAULT W= command).
Please note that this may not return the value 0 when the eagle stack is empty. For example this will happen if the buffer is not empty, or if there are existing user defined indices.
vector
Any of the phrases permitted in the let p<i>= command. At least three values will be returned. When more than one value is returned by an assignment, they will be recorded in <nvar>,<nvar+1> etc. e.g. v1=p1 stores values in v1, v2 and v3.
|
Examples
let min_value = min(v1,v2,v3,v10,v12)
let v10 = asin(v2/sqrt(v2*v2*v3*v3))
x=5, y=14, z=0.5671
string_length = len(first_string), v15=len(last_string)
dist = dist(p10,(1000,1200,460))
v10 = current_point
x=min(v1\50)
height = dist(ptb,pth)
value= ^string
Notes
As can be seen from the examples, multiple assignments can be made on the same command line by separating assignments with commas.
The keyword LET is optional. For instance, the following commands give the same file:
let my_var=dist(p1,p100)
my_var=dist(p1,p100)
Weaseling is not available at all installations.
See also
INFFUN, NOTAT, SYSFUN, VECTOR, data, fragment, weasel, numerics
let <svar> = <str> | <function>
Function
Give a value to one of the program string variables. The command word LET may be omitted.
Parameters
|
svar
|
The string variable to be given a value.
|
|
|
|
|
str
|
An expression comprising a sequence of string items concatenated through '//' operand. The permitted string items are as follows:
|
|
|
<svar> a string variable or sub-string
'<text> 'literal text within single quotes
d the current date string
t the current time string
sl latch string
st notify text input string
"<"<n>">" a numeric value in character form
|
|
|
|
|
function
|
A character string derived from one of the following functions:
att(<i>)
the value of attribute code <i> of the currently selected model item <i> may have a value 1 through 11, where 11 indicates the location code rather than an attribute code.
atti(<i>)
attribute information, similar to ATT, but from the last identified item rather than the currently selected item.
clas(<file>)
the classification code of the submodel "file", default extension MOD. The string ** will be returned if the submodel has no classification code.
data(<svar>{,<file>})
value of string variable <i> from a Design Data File
date(<file>)
the last-modified date of "file". The default file extension is MOD.
env(<text>)
the value of an external environment variable "text". Text will be converted to upper case.
file(<svar>)
the simple file name part of the string when used as a file pathname.
fmt(<n>,<i>)
a formatted value of <n> rounded to <i> decimal places with trailing zeros after the decimal point.
format(<filename>)
String function: FORMAT(<filename>) determines if a model file is written in v.11. or v.12 format.
Comment: the following string values are returned:
"12" for V12 MOD-files format
"11" for MOD-files earlier then V12
"" for non-MOD files
(Function introduced 12.1.0)
full(<text>)
the full pathname of "text" interpreted as a file name.
ind(<i>)
the value of user-index name <i> of the currently selected model item. <i> may have a value 1 through to the number of user-indices the item belongs to (the names are returned alphabetically).
indi(<i>)
user-index information, similar to IND, but from the last identified item rather than the currently selected item.
inf(<i>)
model information in the form of a string. The parameter i indicates which information is being requested about the currently selected item. Information available is outlined in another section: "Model Function Information".
infi(<i>)
model information, similar to INF, but about the last identified item rather than the currently selected item.
low(<svar>)
the contents of string svar converted to lower case.
ltrim(<svar>)
trims leading blanks only.
mess(<str1>,<str2>)
a string from the user messages file:
set str1, message str2.
path(<svar>)
the directory part of the string when used as a file pathname. The answer will include the trailing /, \ or @ character.
param(<svar>)
the command line parameters and its value are returned. There are three cases:
a. Parameter specified as –parameter=value:
eagle -ini=eagle.ini -mode=virtual
s1=PARAM(mode)
Value is "virtual"
iferr tell ‘Error: parameter not specified’
b. Parameter specified as –parameter
eagle -ini=eagle.ini -fast
s1=PARAM(mode)
Value is ""
iferr tell ‘Error: parameter not specified’
c. Parameter not specified
eagle -ini=eagle.ini
s1=PARAM(mode)
Value is ""
iferr tell ‘Error: parameter not specified’
Error: parameter not specified
redo(<svar>)
the file of interactive line editing on the contents of string variable n.
rtrim(<svar>)
trims trailing blanks only.
sys(<i>)
an item of system information in the form of a string. The <i> parameter indicates what system information is being requested. The possible available system information items are outlined in the System Function Information section.
sysenv(<text>)
the value of an system environment variable "text". Text will be converted to upper case.(12.5.1)
text(<i>)
the value of annotation line <i> of the currently selected model item. The item should be a text item: i.e. an annotation or dimension.
texi(<i>)
annotation information, similar to TEXT, but from the last identified item rather than the currently selected item.
time(<file>)
the last-modified time of "file". The default file extension is MOD.
trim(<svar>)
trims leading and trailing blanks.
upp(<svar>)
the contents of string svar converted to upper case.
|
Examples
let direction=‘north’
let current_date='the current date is'//d
let first_lenght=<v10/10>//' mm.', last_lenght=<v10*100>//' cm.'
current_date=upp(current_date)
s40=data(s1), cur_matched=data(s1,match.var)
file_date=date(myfile), s11=time(layout.cmd)
s50=sys(10)
new_string = 'this is a good day for '// his_name
name = 'John'
LET s1=trim(s1),s2=ltrim(s2),s3=rtrim(s3)
Notes
As can be seen from the examples, multiple assignments can be made on the same command line by separating assignments with commas.
The keyword LET is optional. For instance, the following commands give the same result:
let my_var=att(9)
my_var=att(9)
Update from 11.6.6 (b01) :Three new string functions have been made available:
TRIM, LTRIM, RTRIM.
LET s1=trim(s1),s2=ltrim(s2),s3=rtrim(s3)
They respectively trim leading and trailing blanks, leading blanks only and trailing blanks only.
See also
INFFUN, NOTAT, SYSFUN, annotate, attribute, classify, data, date, index, time, strings, polling, notify
let <pvar> = <vector> | C | <function>
Function
Give co-ordinate values to one of the program attach points. The command word LET may be omitted.
Parameters
|
pvar
|
The attach point to be given values.
|
|
|
|
|
vector
|
A language vector phrase measured from current control yielding a 3-D point.
|
|
|
|
|
c
|
The co-ordinates of current control.
|
|
|
|
|
function
|
A 3-D point derived from one of the following functions:
cros(<vector>,<vector>)
cross product of two 3-D points or direction cosines.
crud(<vector>,<vector>,<vector>,<vector>)
returns two points at either end of the minimum distance between two lines. If the lines are parallel, an error is recorded.
crux({o}<vector>,<vector>,{o}<vector>,<vector>)
or
crux({(o)}<vector>,<vector>,{(o)}<vector>,<vector>)
the point of intersection between two lines, two circles, or a line and a circle. All points are defined by vector phrases, with the character "O" used to indicate a circle, defined by its centre and a point on its circumference. A line is indicated, without an "O", by two points.
The second form handles possible ambiguities caused by named variable whose name starts with the character 'O'.
data(pvar{,<file>})
value of attach point PVAR from a Design Data File
derivatives( <vector> )
Returns two or three points depending on the type of the selected item. If the selected item is a Curve then the function returns two values:
the Normal and the Su for the curve on the given point.

If the selected item is a Surface then the function returns three values:

the Normal, the Su and the Sv derivative of the surface on the given point (Introduced V14 [OCC])
dirc(<vector>,<vector>)
the direction between two points in the form of normalised direction cosines.
drop(<vector>,<vector>,<vector>,<vector>)
the point on a plane (defined by points 1,2 and 3) obtained by dropping a perpendicular from another point (the 4th) onto the plane.
frst(<vector>,<vector>,<vector>)
the further of two points, defined by vector phrases 1 and 2, to a third point, defined by vector phrase 3.
inf(<i>)
model information in the form of one or more 3-D point values. The parameter <i> indicates which information is being requested about the currently selected item. Information available is outlined in another section: "Model Function Information".
infi(<i>)
model information, similar to INF, but about the last identified item rather than the currently selected item.
midp(<vector>,<vector>)
the mid-point of a line between two points defined by vector phrases.
nrst(<vector>,<vector>,<vector>)
the nearer of two points, defined by vector phrases 1 and 2, to a third point, defined by vector phrase 3.
perp({o}<vector>,<vector>,<vector>)
or
perp({(o)}<vector>,<vector>,<vector>)
the point on a line or circle, defined by vector phrases 1 and 2, which is closest to a third point, defined by vector phrase 3. A line is indicated, without an "O", by two points. A circle is indicated, with the character "O", by its centre and a point on its circumference.
The second form handles possible ambiguities caused by named variable whose name starts with the character 'O'.
plax(<vector>,<vector>,<vector>,<vector>,<vector>)
the intersection of a line, defined by points 1 and 2, and a plane defined by points 3,4 and 5.
size(<file>)
the extremities of a submodel "file", (default extension MOD), or contour map file, or plot file. Two points will be returned: the maximum X,Y,Z and the minimum X,Y,Z.
surx(<vector>,<vector>,<vector>,<vector>,<vector>,
<vector>)
the intersection of two surfaces (planes), the first defined by points 1,2,3, the second by points 4,5,6. Two points will be returned, defining the line of planar intersection.
sys(<i>)
an item of system 3-D point information. The parameter <i> indicates which system information is being requested. Available system information is outlined in another section: "System Function Information".
If a function could yield two answers, for example the intersection of two circles, the answers will be recorded in Pi and Pi+1.
|
|
|
upos(<uvalue>)
returns a point that is at distance <u-value> in the U-direction from the start of the curve.

uvpos(<uvalue,vvalue>)
returns a point that is at distance <u-value> in the U-direction and <v-value> in the V-direction from the origin of the Surface.

|
Examples
POINTS P1\20
SELECT XC
POLLING L;'Indicate a point on the curve';;
uncursor
P20=L
P1 = DERIVATIVES(P20)
let last_input=c
p4 = p5&u700, key_point = p0
p20 = crux(key_point,p2,p0,(0,0,10))
def_point = crux(op10,last_point,c,new_point)
p21 = crux((o)point,p11,point,p2)
p50 = midp(p20,last_input)
p_base = (0,0,0)
new_point = p_base&e200
Notes
As can be seen from the examples, multiple assignments can be made on the same command line by separating assignments with commas.
The keyword LET is optional. For instance, the following commands give the same file:
let my_var=c
my_var=c
See Also
INFFUN, NOTAT,SYSFUN, data, get, map, points
let DATA( <nvar> | <svar> | <pvar> {,<file>} )
= ( <n> | <str> | <vector> )
Notes
Update the value of a numeric variable, string variable or attach point in a Design Data File. The command word LET may be omitted.
Parameters
|
nvar
|
Update the value of numeric variable nvar in the Design Data File.
|
|
n
|
The value to be written to the file when nvar is updated.
|
|
|
|
|
svar
|
Update the value of string variable svar in the Design Data File.
|
|
str
|
The value to be written to the file when svar is updated.
|
|
|
|
|
pvar
|
Update the value of attach point pvar within the Design Data File.
|
|
vector
|
The value to be written to the file when pvar is updated.
|
|
|
|
|
file
|
The name of the Design Data File to be updated. The default file extension is VAR. If this parameter is omitted, the default Design Data File will be updated (refer to the DATA command).
|
Examples
let data(current_pen,my_file)=750
data(drawing_name)=drwng1, data(s2)=d
data(last_input,contour)=(12350,27400,24000)
data(p1,linst1)=data(p1,linst2)
Notes
As can be seen from the examples, multiple assignments can be made on the same command line by separating assignments with commas.
The keyword LET is optional. For instance, the following commands result in the same file:
let data(my_var,my_file)=400
data(my_var,my_file)=400
See also
data, variables, retrieve