AutoLISP Developer's Guide

3y ago
60 Views
3 Downloads
8.53 MB
991 Pages
Last View : 1m ago
Last Download : 2m ago
Upload by : Roy Essex
Transcription

AutoLISP Developer's Guide IntroductionFor years, AutoLISP has set the standard for customizing AutoCAD . NowVisual LISP (VLISP) represents the next generation of LISP for AutoCAD, byadding significantly more capabilities. VLISP extends the language to interfacewith objects via the Microsoft ActiveX Automation interface, and enhances theability of AutoLISP to respond to events through the implementation of reactorfunctions. As a development tool, VLISP provides a complete, integrateddevelopment environment (IDE) that includes a compiler, debugger, and othertools to increase productivity when customizing AutoCAD.AutoLISP and Visual LISPUsing Visual LISP DocumentationRelated DocumentsPlease send us your comment about this page

AutoLISP Developer's Guide Introduction AutoLISP and Visual LISPAutoLISP is a programming language designed for extending and customizingAutoCAD functionality. It is based on the LISP programming language, whoseorigins date back to the late 1950s. LISP was originally designed for use inArtificial Intelligence (AI) applications, and is still the basis for many AIapplications.AutoCAD introduced AutoLISP as an application programming interface (API)in Release 2.1, in the mid-1980s. LISP was chosen as the initial AutoCAD APIbecause it was uniquely suited for the unstructured design process of AutoCADprojects, which involved repeatedly trying different solutions to designproblems.Visual LISP (VLISP) is a software tool designed to expedite AutoLISP programdevelopment. The VLISP integrated development environment (IDE) providesfeatures to help ease the tasks of source-code creation and modification, programtesting, and debugging. In addition, VLISP provides a vehicle for deliveringstandalone applications written in AutoLISP.In the past, developing AutoLISP programs for AutoCAD meant supplying yourown text editor for writing code, then loading the code into AutoCAD andrunning it. Debugging your program meant adding statements to print thecontents of variables at strategic points in your program. You had to figure outwhere in your program to do this, and what variables you needed to look at. Ifyou discovered you still didn't have enough information to determine the error,you had to go back and change the code again by adding more debugging points.And finally, when you got the program to work correctly, you needed to eithercomment out or remove the debugging code you added.What Visual LISP OffersWorking with Visual LISP and AutoCAD

Please send us your comment about this page

AutoLISP Developer's Guide Introduction AutoLISP and Visual LISP What Visual LISP OffersDuring the development cycle of an AutoLISP application or routine, theAutoLISP user performs a number of operations that are not available within theAutoCAD software. Some of these operations—like text editing—are availablewith other software tools. Others, such as full AutoLISP source-level debugging,are introduced only with VLISP. In VLISP, you perform most of the necessaryoperations inside a single environment. This permits text editing, programdebugging, and interaction with AutoCAD and other applications.The following are components of the Visual LISP IDE:Syntax Checker recognizes erroneous AutoLISP constructs and improperarguments in calls to built-in functions.File Compiler improves the execution speed and provides a secure andefficient delivery platform.Source Debugger, designed specifically for AutoLISP, supports steppingthrough AutoLISP source code in one window while simultaneouslydisplaying the results of code execution in an AutoCAD drawingwindow.Text File Editor uses AutoLISP and DCL color coding, as well as otherAutoLISP syntax support features.AutoLISP Formatter restructures programs into an easily readableformat.Comprehensive Inspect and Watch features provide convenient access tovariable and expression values for data structure browsing andmodification. These features may be used to explore AutoLISP data andAutoCAD drawing entities.Context-sensitive Help provides information for AutoLISP functions anda powerful Apropos feature for symbol name search.

Project Management system makes it easy to maintain multiple-fileapplications.Compiled AutoLISP files are packaged into a single module.Desktop Save and Restore capabilities preserve and reuse the windowingenvironment from any VLISP session.Intelligent Console window introduces a new level of convenience andefficiency for AutoLISP users. The basic functions of the Consolecorrespond to the AutoCAD Text Screen functions and provide a numberof interactive features, such as history scrolling and full-input lineediting.Please send us your comment about this page

AutoLISP Developer's Guide Introduction AutoLISP and Visual LISP Working with Visual LISP and AutoCADVLISP contains its own set of windows and menus that are distinct from the restof AutoCAD, but VLISP does not run independently of AutoCAD. Wheneveryou work in VLISP, AutoCAD must also be running. When you run AutoLISPprograms from the VLISP IDE, you will usually need to interact with theAutoCAD graphics or Command windows to respond to program prompts.If AutoCAD is minimized when VLISP turns control over to it, you mustmanually restore and activate the AutoCAD window to continue. VLISP will notrestore the AutoCAD window for you. Instead, a Visual LISP symbol appears inthe VLISP window and remains there until you activate AutoCAD and respondto the prompts at the AutoCAD Command prompt. The Getting Started chaptershows an example of this; see Loading and Running AutoLISP Programs.Please send us your comment about this page

AutoLISP Developer's Guide Introduction Using Visual LISP DocumentationThe AutoLISP Developer's Guide explains how to use the Visual LISP IDE andhow to build and run AutoLISP applications. This guide also introduces theconstructs of the AutoLISP language.All users should check the AutoCAD Readme file for notices concerningAutoLISP and Visual LISP. The Readme file is in the AutoCAD Help directoryand contains information that became available too late to be included in thismanual.If you have developed AutoLISP applications in earlier releases of AutoCAD, itis important that you refer to the Readme file for information on AutoLISPchanges that may affect your applications.Additional AutoLISP and Visual LISP manuals are available online through theVisual LISP and AutoCAD Help menus:The AutoLISP Reference describes every AutoLISP function andprovides examples. Refer to the AutoLISP Reference when you need tolook up the syntax of a function or determine what a function returns.The AutoLISP Tutorial contains step-by-step instructions guiding youtoward building a working Visual LISP application.This AutoLISP Developer's Guide assumes you have some experience withAutoCAD and have basic user-level skills with Microsoft Windows . Priorexperience with AutoLISP is not required.The AutoLISP Developer's Guide is divided into the following sections:Using the Visual LISP Environment describes how to use VLISP todevelop and test AutoLISP programs.Using the AutoLISP Language is a detailed guide describing theelements and structures of the AutoLISP language.

Working with Programmable Dialog Boxes describes how to design andimplement dialog boxes in your AutoLISP applications.Appendixes includes a function synopsis summarizing AutoLISPfunctions by category, information on AutoLISP error codes, and asummary of the environment and program options available in VisualLISP.The following are a few guidelines to help you get the most out of the AutoLISPDeveloper's Guide:Begin by reading chapter 1, Getting Started. This chapter tells you howto invoke VLISP from AutoCAD, identifies what you'll see when VLISPfirst starts, and describes how to load and run existing AutoLISPprograms from VLISP. Chapter 1 introduces and briefly describes thewindows you will be working with in the VLISP IDE. Use this chapterto orient yourself to the VLISP environment.If you do not already know AutoLISP, read all of chapter 8, AutoLISPBasics, and at least browse chapters 9 and 10, Using AutoLISP toCommunicate with AutoCAD and Using AutoLISP to ManipulateAutoCAD Objects, respectively. After that, you can either work throughthe tutorial or read more chapters in the AutoLISP Developer's Guide.To search for a function that meets a particular programming need, referto AutoLISP Function Synopsis, in this guide.The following table summarizes the organization of this manual:Chapter organizationChapterTitleContents1Getting StartedProvides anorientation to VisualLISP.2DevelopingPrograms withShows you how to usethe VLISP text editorto enter AutoLISPVisual LISP

program code, formatthe code, and checkthe code for AutoLISPsyntax errors. Alsoshows you how to runthe code you'vedeveloped from theVLISP editor window.3DebuggingProgramsShows you how to useVLISP to traceprogram execution,watch the value ofvariables changeduring programexecution, see thesequence in whichexpressions areevaluated, and stepthrough programexecution oneinstruction at a time.4BuildingApplicationsIntroduces the VLISPfile compiler andshows how you canuse the VLISPApplication Wizard tobuild standaloneapplications.5MaintainingVisual LISPApplicationsDescribes how todefine VLISP projectsand use them tosimplify working withmulti-fileapplications. This

chapter also explainscompiler optimizationfeatures, and how touse them in a project.6Working withActiveXDescribes how to useActiveX objects withVLISP, and how toaccess otherapplications throughActiveX.7AdvancedTopicsDescribes how toattach reactors toAutoCAD drawingsand objects.8AutoLISPBasicsIntroduces basicAutoLISP concepts,such as how to useexpressions andvariables, handlenumbers and strings,display output, buildlists, and definefunctions.9UsingAutoLISP toCommunicatewith AutoCADDescribes AutoLISPfunctions that you canuse to issue AutoCADcommands and tointeract with users inthe AutoCADenvironment.UsingAutoLISP toDescribes AutoLISPfunctions you can use10

ManipulateAutoCADObjectsto manipulateAutoCAD drawingentities, selection sets,extended data, andsymbol tables.11DesigningDialog BoxesIntroduces theelements that make updialog boxes. ExplainsDCL file structure andsyntax, and presentsAutoLISP and DCLcode that defines anddisplays a sampledialog box.12ManagingDialog BoxesDescribes how tocontrol dialog boxeswith AutoLISPprograms.13ProgrammableDialogLists and describes allthe DCL tiles andtheir associatedattributes, andsummarizes theAutoLISP functionsavailable tor workwith programmabledialog boxes.Box ReferencePlease send us your comment about this page

AutoLISP Developer's Guide Introduction Related DocumentsIn addition to the AutoLISP Reference and the AutoLISP Tutorial, several otherAutoCAD publications may be required by users building applications withVisual LISP:AutoCAD ActiveX and VBA Reference contains information onaccessing ActiveX methods, properties, and objects. If you developAutoLISP applications that use ActiveX automation to referenceAutoCAD objects, you will need to refer to this reference. It is availablethrough the AutoCAD and Visual LISP Help menus.AutoCAD Customization Guide contains basic information on creatingcustomized AutoCAD applications. For example, it includes informationon creating customized menus, linetypes, and hatch patterns. TheCustomization Guide is available through the AutoCAD and Visual LISPHelp menus.The DXF Reference describes drawing interchange format (DXFTM) andthe DXF group codes that identify attributes of AutoCAD objects. Youmay need to refer to the DXF Reference when working with associationlists describing entity data. The DXF Reference is available through theAutoCAD and Visual LISP Help menus.The ObjectARX Reference contains information on using ObjectARX to develop customized AutoCAD applications. AutoCAD reactorfunctionality is implemented through ObjectARX. If you developAutoLISP applications that implement reactor functions, you may wantto refer to this manual.The ObjectARX Reference is not included when you install AutoCAD.To obtain the manual, download the ObjectARX SDK (SoftwareDevelopment Kit) from the www.autodesk.com.

Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP EnvironmentGetting StartedYou can use Visual LISP to increase your productivity by compilingprograms, stepping through code, and debugging.Developing Programs with Visual LISPWith Visual LISP, you can format your code and automatically detectsyntax errors.Debugging ProgramsTo debug a program, you can trace execution, trace the values ofvariables during execution, and view the sequence in which expressionsare evaluated.Building ApplicationsYou can compile your program files and create a single executablemodule that you can distribute to users.Maintaining Visual LISP ApplicationsYou can maintain large programs by creating a Visual LISP project andoptimizing code.Working with ActiveXWith Visual LISP, you can access the AutoCAD object model.Advanced TopicsYou can use reactors for event notification.Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment Getting StartedYou can use Visual LISP to increase your productivity by compiling programs,stepping through code, and debugging.This chapter introduces you to the look and feel of the Visual LISP interactivedevelopment environment (IDE), and shows you how to run AutoLISP programs in Visual LISP.Starting Visual LISPExploring the Visual LISP User InterfaceTouring the Visual LISP MenusUnderstanding the Console WindowUnderstanding the Visual LISP Text EditorLoading and Running AutoLISP ProgramsExiting Visual LISPPlease send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Starting Visual LISPThe Visual LISP (VLISP) interactive development environment runs in aseparate set of windows from the rest of AutoCAD . You must explicitly startVLISP to work in the interactive development environment.To start Visual LISP1. Start AutoCAD.2. Choose Tools AutoLISP Visual LISP Editor from the AutoCADmenu, or enter the following at the Command prompt:vlispYou can use either the menu or the vlisp command to return to the VLISP IDEat any time.Note that AutoCAD also recognizes the vlide command to start or return toVisual LISP. This command name stands for “Visual LISP interactivedevelopment environment.” AutoCAD issues the vlide command to callVLISP, and as a result you may sometimes see “VLIDE” displayed in theAutoCAD Command window.Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Exploring the Visual LISP User InterfaceWhen you first start Visual LISP, the following components are displayed:MenuYou can issue VLISP commands by choosing from the various menu items. Ifyou highlight an item on a menu, VLISP displays a brief description of thecommand's function in the status bar at the bottom of the screen.ToolbarsClick toolbar buttons to issue VLISP commands quickly. There are fivetoolbars—Debug, Edit, Find, Inspect, and Run—each representing a distinctfunctional group of VLISP commands. You can execute many, but not all,menu commands from the toolbars. If you move your mouse pointer over atoolbar button and leave it there for a couple of seconds, VLISP displays atooltip indicating the function of the button. A more descriptive explanationappears in the status bar at the bottom of the VLISP screen.Console WindowThis is a separate, scrollable window within the main VLISP window. In theConsole window, you can type AutoLISP commands, similar to the way youdo in the AutoCAD Command window. You can also issue many Visual LISPcommands from this window, instead of using the menu or toolbars. SeeUnderstanding the Console Window for more information on the Consolewindow.Status BarThe information displayed in the status bar located at the bottom of thescreen varies according to what you are doing in VLISP.You may also see a minimized Trace window. During startup, this window

contains informational messages about the current release of VLISP, and maycontain additional information if VLISP encounters errors during startup.Introducing the Visual LISP Text EditorOther Visual LISP WindowsPlease send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Exploring the Visual LISP User Interface Introducing the Visual LISP Text EditorYou will spend much of your time in VLISP creating or modifying AutoLISPprograms. VLISP comes with an integrated text editor for you to use withAutoLISP code.To see how the text editor window displays code, open a sample AutoLISPprogram. Begin with the drawline.lsp file provided with VLISP.The sample files are only included in your installation if you chose a Fullinstallation, or if you chose a Custom installation and selected the Visual LISPSamples item. If you previously installed AutoCAD and did not install thesamples, rerun the install, choose Custom, and select the Visual LISP Samplesitem.NoteTo view a LISP program in the VLISP text editor1. From the VLISP menu, choose FileOpen File.2. In the Open File dialog box, select the Sample\VisualLISP folder, whichis in your AutoCAD installation directory.3. Double-click the drawline.lsp file.VLISP opens the file in a new window—the text editor window—anddisplays the name of the file in the status bar. If you make a change tothe text in the editor window, or add new text, VLISP places an asterisk(*) next to the file name in the status bar. The asterisk remains next tothat file name until you either save your changes or close the file.You can work on more than one file at a time. Each time you open a file,VLISP displays the file in a new text editor window.

Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Exploring the Visual LISP User Interface Other Visual LISP WindowsVLISP displays some output in the Console window, but several VLISPfunctions create their own windows in which to display results. For example,when you trace the sequence of events during a running AutoLISP program, theTrace function opens a window and displays program events. You cannot entertext in these output windows, but you can copy text from them and paste the textinto the editor or Console windows.Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Touring the Visual LISP MenusYou can issue VLISP commands by choosing from the various menu items. Forexample, from the File menu you can create a new AutoLISP program file, selectan existing program file to edit, and print the file you're editing.Variable Menu ContentsVisual LISP Menu SummaryPlease send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP Environment GettingStarted Touring the Visual LISP Menus Variable Menu ContentsMenu contents may vary depending on which VLISP window (for example, texteditor, Console) is active. To activate a different window, click in the window'stitle bar, or in any empty area of that window.As an example, click in the text editor window containing the drawline.lsp file,then choose Edit from the VLISP menu. You'll see the following list:Note that the last items on the menu are Parentheses Matching and ExtraCommands.Now click in the title bar of the VLISP Console window, then select the Editmenu item again:

Notice that Extra Commands is no longer the last item on the menu. ParenthesesMatching is followed by two new items, Console History Up and ConsoleHistory Down; these items apply only to a Console window.Please send us your comment about this page

AutoLISP Developer's Guide Using the Visual LISP

Visual LISP: AutoCAD ActiveX and VBA Reference contains information on accessing ActiveX methods, properties, and objects. If you develop AutoLISP applications that use ActiveX automation to reference AutoCAD objects, you will need to refer to this reference. It is available through the AutoCAD and Visual LISP Help menus.

Related Documents:

AutoLISP Programming Techniques AutoLISP Programming Techniques Lesson One in the CADalyst/University of Wisconsin Advanced AutoLISP Programming course covers AutoLISP program structure & development. by Anthony Hotchkiss, Ph.D, P.Eng. About this course. Advanced AutoLISP Programmin

AutoLISP Functions AutoLISP Functions The following is a catalog of the AutoLISP functions available in AutoCAD . The functions are listed alphabetically. In this chapter, each listing contains a brief description of the function's use and a function syntax statement showing the order and the type of arguments required by the function.File Size: 1MB

3.1 Handling of string in AutoLISP : AutoLISP is basically a graphics mode output program tool but text also forms a part of drawings and diagrams, so handling the string is also a important part of AutoLISP programming. String is nothing but a sequence of alphanume

AutoLISP (1) Pripremio Dragan Cvetković AutoLISP je poseban deo LISP programskog jezika, koji se isporučuje unutar programskog paketa za projektovanje AutoCAD. AutoLISP omogućava korisnicima AutoCAD-a da pišu i kreiraju makroe i funkcije u višem programskom jeziku, što je izuzetno p

For descriptions of the AutoLISP functions that use group codes, see "Using AutoLISP to Manipulate AutoCAD Objects," in the AutoLISP Developer's Guide. Revisions to the DXF Reference This topic lists revisions since the last update of the DXF Reference. The version number of this DXF Reference is u19.1.01. "ENTITIES Section"

Phần 2.AUTOLISP Chương 1. CĂN BẢN VỀ AUTOLISP LISP là một ngôn ngữ lập trình bậc cao thường được dùng cho việc nghiên cứu trí tuệ nhân tạo. LISP viết tắt của List Processing đã được Jonh McCarthy và các đồng nghiệp tại viện kỹ thuật Massachusets biên soạn từ những năm đầu của thập niên 1960.

El entorno de Visual Lisp es un módulo que se carga bajo demanda. No está incluido en el propio núcleo de AutoCAD, como ocurre con el evaluador de AutoLISP. El nuevo conjunto de funciones incorporadas en Visual Lisp permite trabajar en diferentes áreas y niveles que incluyen funciones añadidas de AutoLISP, funciones de acceso al sistema

Changes in Oracle SQL Developer Release 18.1 xlviii 1 SQL Developer Concepts and Usage 1.1 About SQL Developer 1-2 1.2 Installing and Getting Started with SQL Developer 1-2 1.3 SQL Developer User Interface 1-3 1.3.1 Menus for SQL Developer