Putting the Code Together

AutoCAD Visual LISP

Putting the Code Together

With the examples above, and a few additional lines, you have the code needed to complete the gp:getDialogInput function.

To put gp:getDialogInput together

  1. Open your copy of gp-io.lsp in a VLISP text editor window.
  2. Delete the code in gp:getDialogInput (the defun gp:getDialogInput statement and everything after it).
  3. Enter the following defun statement as the first line of code in the gp:getDialogInput function:
    (defun gp:getDialogInput (pathWidth / dcl_id objectCreateMethod
                   plineStyle tilerad tilespace result UserClick
                   dialogLoaded dialogShow)

    The function expects a single argument (pathwidth), and establishes a number of local variables.

  4. Following the code you added in step 3, enter the sample code from each of the following sections:
    NoteEnter just the first code example from Assigning Actions to Tiles not the fragments in the explanations that follow. Those fragments just repeat pieces of the example.
  5. After the last line of code, add the following:
    ) ;_ end of defun
  6. Format the code you entered by choosing Tools Format Code in Editor from the VLISP menu.