Download 31295008888132

Transcript
Here the acad.pgp file is used to define an external command ~ TRIAC.
AutoCAD ignores blank lines and all text to the right of a semicolon. The following is an
example of an acad.pgp external commands section, the external command "TRIAC" is
added:
DEL, DEL,
0, File to delete: ,4
DIR,DIR,
0, File specification: ,0
EDIT, EDLIN,0, File to edit: ,4
SH,,
0, *0S Command: ,4
SHELL,,
0,*OS Command: ,4
TYPE, TYPE,
0, File to list:, 0
TRIAC, TRIAC,
0,
,4
The first TRIAC is the AutoCAD external command name. The second TRIAC is
the file command. It is sent to the operating system for execution when the command
name is entered. The number '0' presents a field which serves to maintain compatibility
with previous versions of AutoCAD. The next field is called prompt field. It specifies a
prompt to be displayed after the command is used. TRIAC command does not need
prompt. Hence, keep the field empty. After the command is executed, the number '4'
called return code is used to return to previous screen mode. The defined external
commands are for interactive use only.
3.2 AutoLISP Programming Language
One of the most powerful capabilities for extending AutoCAD is AutoLISP.
AutoLISP, an integral part of AutoCAD, is a specialized implementation of the LISP
programming language. It is used to create new AutoCAD commands and automate
37