Once the library context is successfully opened and a library variable has been created, the statement is executed. Within the scope of the statement the library variable can be accessed to retrieve further data from the library.
If the current editor window does not contain a library drawing, an error message is given and the ULP is terminated.
Check if there is a library
By using the library statement without an argument you can check if the current editor window contains a library drawing. In that case, library behaves like an integer constant, returning 1 if there is a library drawing in the current editor window, and 0 otherwise.
Example
if (library) library(L) { L.devices(D) printf("Device: %s\n", D.name); }
Index | Copyright © 2005 CadSoft Computer GmbH |