插件介绍

优点

AutoCAD插件的优点:

  • 使添加新特性变得简单
  • 允许第三方开发者开发新特性
  • 给予用户自由定制特性

插件文件格式

.fas:由AutoLISP创建的AutoLISP已编译文件。FAS文件只包含单个编译过的AutoLISP函数。

.vlx:由AutoLISP创建的AutoLISP已编译文件。VLX文件包含多个编译过的AutoLISP函数。

.lsp:AutoLISP源代码文件,该文件由ASCII编码格式保存。

FAS文件和VLX文件的区别

从语义上理解,, 一个函数只包含一个功能,FAS只能包含一个AutoLISP函数,那么FAS文件提供的功能是单一的,只能作为单一目的的插件使用。

VLX文件是独立的AutoCAD应用程序,可以包含多个AutoLISP函数(可能存在个别函数是从FAS文件引入的),因此VLX文件的功能更多样,更强大,可以作为正式的插件使用。

References

Here is a brief summary of the types of files used by the VLISP project management feature:

Visual LISP project file types

File ext.Type of fileFunction
.fasCompiled AutoLISP codeCompiled AutoLISP programs. May be loaded and run, or compiled into VLX modules
.lspAutoLISP source codeProgram source files
.obObject codeUsed internally by VLISP, these files contain compiled AutoLISP code used in building FAS files
.pdbProject databaseUsed internally by VLISP, these files contain symbol information used by the compiler
.prjProject definitionContains the location and names of all source files that build the project, as well as certain parameters and rules on how to create the final FAS files

In addition to the files recognized by the project manager, VLISP either creates, processes, or recognizes a number of additional types of files, as summarized below:

Additional Visual LISP file types

File ext.Type of fileFunction
.dskDesktop saveContains VLISP environment and window settings. (Note: Editing this file may permanently change the VLISP environment. Do not edit this file without creating a backup copy first.)
._xxBackup filesBackup copies of edited files, maintained by the VLISP editor. Backup files contain the same name as the original, except that the file extension begins with the underline character (_) and is followed by the first two characters of the original file’s extension. For example, the backup file of a LSP file has an ._LS extension; the backup of a DCL file has a ._DC extension.
.vlxStand-alone applicationsStand-alone AutoCAD applications, which can be created using the VLISP Make Application wizard.
.c, .cpp, .cch, .hpp, .hhLanguage source filesContain program source code. The VLISP editor recognizes the syntax of these files and color-codes reserved words, strings, and numbers.
.dclDialog control languageContains definitions of AutoCAD dialog boxes. VLISP can preview these files, and you can include them in Visual LISP executable (VLX) files.
.prvMake applicationDefines the files and options used to build a VLX application with the VLISP Make Application wizard.
.sqlStructured query languageContains SQL statements. The VLISP text editor recognizes this file type and color-codes the text according to SQL syntax rules.

Help: About LISP, FAS, and Other File Types (AutoLISP)

What’s the technical definition for “routine”? - Stack Overflow

VLX or FAS file? - Autodesk Community - AutoCAD

Help: About AutoLISP Program Files (AutoLISP)

插件使用

在插件使用上,我们只关注可以提供多个功能的.vlx文件和提供单一功能的.fas文件。