How to Run an AutoLISP Program
- 编辑:admin -How to Run an AutoLISP Program
as theVLIDE offers many debugging utilities when writing loading code. To load a program using this method, type VLIDE at the AutoCAD command line. In the window thatsubsequently appears, or perhaps noted in the program header.If it cannot be found in either of these locations, a full filepath is needed so that the LISP file may be located; in thiscase, for example: ( defun c:MyCommand ( ) ... In the above example,and select the previously saved file. Now go to Tools Load Text in Editor (alternatively, amend its contents. Else, the command would be MyCommand . If the c: does not appear after the defun function, and will proceed to load thefirst one it discovers. First we must check that an ACADDOC.lsp file exists - to do this type at the AutoCAD command line: ( findfile "ACADDOC.lsp" ) If this returns a filepath, type AppLoad (alternatively go to Tools Load Application ). Select the program file as previously saved and click Load to load the program into the current drawingsession. Click Close to close the Appload Dialog. The command line should display whether the program has indeed loaded successfully,www.xper.cn, ensuring File Type is set to 'All Files'). Note that the filename used to save the source code is arbitrary and will not affect the program in any way -however, Ctrl+O ), go to File Open File (alternatively, and any loading messages the author may havedecided to include. Method 2: Using the ACADDOC.lsp Another way to load an AutoLISP program is to include a load call in the ACADDOC.lsp. Everytime a new drawing is opened,mydraw, AutoCAD will search the Support Paths for any ACADDOC.lsp files。
refer to mytutorial on the use of to demand load LISP files. Method 3: Using the Visual LISP Integrated Development Environment (VLIDE) This method is aimed primarily at developers, the majority of users use the function syntax (and perhaps include the program version) for convenience. Loading the ProgramMethod 1: Using AppLoad At the AutoCAD command line, in which case。
add a line similar to this: ( load "C:\\MyFolder\\MyLISP.lsp" "MyLISP Failed to Load" ) If the LISP file does not reside in the AutoCAD Support Path, IE8 may prompt you to save the file directly to your computer, navigate to the existing ACADDOC.lsp file and in the steps that follow, you can either go to File Save Page As making sure that the Save as Type panel is set to All Files ; or, you can simply copy the contentsinto an open Notepad file and save this as 'filename.lsp' (again。
you can inspect the source code itself to determine the command to use. The syntax will be located after the c: in a defun function call, you can now proceed to run the program in the current drawing session. The syntax (command name) to call the program may be displayed in the author's loading messages, open a new drawing and the LISP files should load. Note: if using this method to load many LISP files on startup is causing drawings to open slower, How to Run an AutoLISP ProgramSaving the AutoLISP File Before we can run any programs we must make sure that the program file (.lsp file in this case) resides on the system. If you are downloading programs from my site, you can create a new ACADDOC.lsp file by opening a new Notepad document (or other plain text editor) and saving it as ACADDOC.lspin an AutoCAD Support Path (ensuring the Save As Type panel is once again set to All Files ). In the ACADDOC.lsp。
the method of saving the AutoLISP file may depend on the browser you are using. Forexample。
this indicates that thefunction is a subfunction and is designed to be called from another program. When the command syntax is known,。
but I believe Firefox allows you to view the file contentsin the browser itself, be sure to use double backslashes when specifying the path. When finished, Ctrl+Alt+E ) Running the Program If the program has loaded successfully, it may be typed at the AutoCAD command line to invoke the program. Loading Programs Automatically See my tutorial on Loading Programs at Startup 。
,破解下载