1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
<html>
<head>
<title>EAGLE Help: schematic()</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>schematic()</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a schematic context.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>schematic(identifier) statement</tt>
<p>
<dt>
<b>Description</b>
<dd>
The <tt>schematic</tt> statement opens a schematic context if the current editor
window contains a schematic drawing. A variable of type
<a href=188.htm>UL_SCHEMATIC</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the schematic context is successfully opened and a schematic variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the schematic variable can be accessed to retrieve further
data from the schematic.
<p>
If the current editor window does not contain a schematic drawing, an error
message is given and the ULP is terminated.
<p>
</dl>
<b>See also</b> <a href=274.htm>board</a>,
<a href=276.htm>library</a>,
<a href=280.htm>sheet</a>
<p>
<b>Check if there is a schematic</b>
<p>
By using the <tt>schematic</tt> statement without an argument you can check
if the current editor window contains a schematic drawing. In that case,
<tt>schematic</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a schematic drawing in the current editor window, and <tt>0</tt>
otherwise.
<p>
<b>Accessing schematic from a board</b>
<p>
If the current editor window contains a board drawing, you can still
access that board's schematic by preceding the <tt>schematic</tt> statement
with the prefix <tt>project</tt>, as in
<pre>
project.schematic(S) { ... }
</pre>
This will open a schematic context regardless whether the current editor window
contains a schematic or a board drawing. However, there must be an editor
window containing that schematic somewhere on the desktop!
<p>
<b>Access the current Sheet</b>
<p>
Use the <tt><a href=280.htm>sheet</a></tt> statement to
directly access the currently loaded sheet.
<p>
<b>Example</b>
<pre>
if (schematic)
schematic(S) {
S.parts(P)
printf("Part: %s\n", P.name);
}
</pre>
<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright © 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>
|