2011
Table Of Contents
- Contents
- Basic Customization
- Custom Linetypes
- Custom Hatch Patterns
- User Interface Customization
- DIESEL
- Command Scripts
- Introduction to Programming Interfaces
- Shapes and Shape Fonts
- Overview of Shape Files
- Create Shape Definition Files
- Shape Descriptions
- Vector Length and Direction Code
- Special Codes
- Use Special Codes
- Codes 0, 1, and 2: End of Shape and Draw Mode Control
- Codes 3 and 4: Size Control
- Codes 5 and 6: Location Save/Restore
- Code 7: Subshape
- Codes 8 and 9: X-Y Displacements
- Code 00A: Octant Arc
- Code 00B: Fractional Arc
- Codes 00C and 00D: Bulge-Specified Arcs
- Code 00E: Flag Vertical Text Command
- Text Font Descriptions
- Sample Files
- Big Font Descriptions
- Unicode Font Descriptions
- Superscripts and Subscripts in SHX Files
- Index
System Variables
ACADLSPASDOC
Controls whether the acad.lsp file is loaded into every drawing or just the
first drawing opened in a session.
Prevent AutoLISP Errors When Loading Startup Files
See also:
■
S::STARTUP Function: Postinitialization Execution on page 101
If an AutoLISP error occurs while you are loading a startup file, the remainder
of the file is ignored and is not loaded.
Files specified in a startup file that do not exist or that are not in the AutoCAD
for Mac library path generally cause errors. Therefore, you may want to use
the onfailure argument with the load function. The following example uses
the onfailure argument:
(princ (load "mydocapp1" "\nMYDOCAPP1.LSP file not loaded."))
(princ (load "build" "\nBUILD.LSP file not loaded."))
(princ (load "counter" "\nCOUNTER.LSP file not loaded."))
(princ)
If a call to the load function is successful, it returns the value of the last
expression in the file (usually the name of the last defined function or a
message regarding the use of the function). If the call fails, it returns the value
of the onfailure argument. In the preceding example, the value returned by
the load function is passed to the princ function, causing that value to be
displayed at the command prompt.
For example, if an error occurs while AutoCAD for Mac loads the mydocapp1.lsp
file, the princ function displays the following message and AutoCAD for Mac
continues to load the two remaining files:
MYDOCAPP1.LSP file not loaded.
If you use the command function in an acad.lsp or acaddoc.lsp, it should be called
only from within a defun statement. Use the S::STARTUP function to define
commands that need to be issued immediately when you begin a drawing
session.
100 | Chapter 7 Introduction to Programming Interfaces