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