OK...why am I getting errors

Discussion in 'AutoCAD' started by Court Myers, Jul 8, 2004.

  1. Court Myers

    Court Myers Guest

    Below is a routine that I created.. I created a custom tool palette and
    inserted a Command Tool from the helper tools... i put this command in the
    "command string" line ^C^C(load
    "ADG_Standards_Content/Lisp/detailtag_rec01_2005") dtltag_rec01;;

    when this is run the command line returns a value of " First corner:

    Error: bad argument type: point: nil"
    clan you please help

    Court

    ;-----detailtag_rec01_2005.lsp
    ;-----copyright - court myers - architectural design group inc. 2004

    (defun c:dtltag_rec01 (/ *error* )

    ;-----error handler by: R. Robert Bell

    (defun *Error* (Msg)
    (command "._Undo" "_End")
    (cond
    ((not Msg))
    ((member (strcase Msg T)
    '("console break"
    "function cancelled"
    "quit / exit abort"))


    (command "._U"))
    ((princ (strcat "\nError: " Msg))))

    (setvar "clayer" clayer01)
    (setvar "osmode" osmode01)
    (princ))


    ;-----Import ADGLayerKeyStyle and set Layer Key

    (AecImportLayerKeyingStyle "X:\\ADG_Standards\\Architectural Desktop 2005
    Standards\\Layers\\ADG_ADT2005_LayerStandards.dwg" "ADG_ADT2005_LayerKeys")
    (setq laykeyset01 (AecGenerateLayerKey "door"))

    ;-----get current variables

    (setq
    scale01 (getvar "dimscale")
    osmode01 (getvar "osmode")
    clayer01 (getvar "clayer")
    )

    ;-----set variables

    (setvar "cmdecho" 0)
    (setq block01
    "ADG_Standards_Content/Blocks_Symbols/2005_Standards/ADG_DetailBubble01.dwg")
    (setvar "attdia" 1)
    (setvar "osmode" 0)
    (setvar "clayer" laykeyset01)
    (setq fltrad (* scale01 0.25))

    ;-----draw filleted box

    (setq pt1 (getpoint "\nFirst corner: "))
    (initget 1)
    (setq
    pt3 (getcorner pt1 "\nOther corner:")
    pt2 (list (car pt3) (cadr pt1))
    pt4 (list (car pt1) (cadr pt3)))

    (setvar "FilletRad" fltrad)
    (command
    ".Pline" pt1 "W" "0" "" pt2 pt3 pt4 "C"
    ".Fillet" "p" pt1
    ".Chprop" "L" "" "LT" "ADGDETAIL" "")

    ;-----draw extention line and insert detail bubble

    (setvar "osmode" 512)

    (setq ext1 (getpoint "\nSpecify the first point:")
    ext2 (getpoint ext1 "\nSpecify the end point:")
    ext3 (polar ext2 (angle ext1 ext2) (* scale01 0.2656250)))
    (command ".pline" ext1 ext2 "")
    (command ".insert" block01 ext3 scale01 "" "")

    ;-----reset vars

    (*Error* nil)
    (princ)
    )

    ;-----end of file
     
    Court Myers, Jul 8, 2004
    #1
  2. Your menu macro has two enters at the end of it. Remove one of the
    semi-colons; the second one was being passed to (setq pt1 (getpoint ...))
    which caused (getcorner) to fail, as pt1 isn't a point list due to the menu
    macro.

    --
    R. Robert Bell


    "Court Myers" <cmyersATadgokcDOTcomNOSPAM> wrote in message
    Below is a routine that I created.. I created a custom tool palette and
    inserted a Command Tool from the helper tools... i put this command in the
    "command string" line ^C^C(load
    "ADG_Standards_Content/Lisp/detailtag_rec01_2005") dtltag_rec01;;

    when this is run the command line returns a value of " First corner:

    Error: bad argument type: point: nil"
    clan you please help

    Court

    ;-----detailtag_rec01_2005.lsp
    ;-----copyright - court myers - architectural design group inc. 2004

    (defun c:dtltag_rec01 (/ *error* )

    ;-----error handler by: R. Robert Bell

    (defun *Error* (Msg)
    (command "._Undo" "_End")
    (cond
    ((not Msg))
    ((member (strcase Msg T)
    '("console break"
    "function cancelled"
    "quit / exit abort"))


    (command "._U"))
    ((princ (strcat "\nError: " Msg))))

    (setvar "clayer" clayer01)
    (setvar "osmode" osmode01)
    (princ))


    ;-----Import ADGLayerKeyStyle and set Layer Key

    (AecImportLayerKeyingStyle "X:\\ADG_Standards\\Architectural Desktop 2005
    Standards\\Layers\\ADG_ADT2005_LayerStandards.dwg" "ADG_ADT2005_LayerKeys")
    (setq laykeyset01 (AecGenerateLayerKey "door"))

    ;-----get current variables

    (setq
    scale01 (getvar "dimscale")
    osmode01 (getvar "osmode")
    clayer01 (getvar "clayer")
    )

    ;-----set variables

    (setvar "cmdecho" 0)
    (setq block01
    "ADG_Standards_Content/Blocks_Symbols/2005_Standards/ADG_DetailBubble01.dwg"
    )
    (setvar "attdia" 1)
    (setvar "osmode" 0)
    (setvar "clayer" laykeyset01)
    (setq fltrad (* scale01 0.25))

    ;-----draw filleted box

    (setq pt1 (getpoint "\nFirst corner: "))
    (initget 1)
    (setq
    pt3 (getcorner pt1 "\nOther corner:")
    pt2 (list (car pt3) (cadr pt1))
    pt4 (list (car pt1) (cadr pt3)))

    (setvar "FilletRad" fltrad)
    (command
    ".Pline" pt1 "W" "0" "" pt2 pt3 pt4 "C"
    ".Fillet" "p" pt1
    ".Chprop" "L" "" "LT" "ADGDETAIL" "")

    ;-----draw extention line and insert detail bubble

    (setvar "osmode" 512)

    (setq ext1 (getpoint "\nSpecify the first point:")
    ext2 (getpoint ext1 "\nSpecify the end point:")
    ext3 (polar ext2 (angle ext1 ext2) (* scale01 0.2656250)))
    (command ".pline" ext1 ext2 "")
    (command ".insert" block01 ext3 scale01 "" "")

    ;-----reset vars

    (*Error* nil)
    (princ)
    )

    ;-----end of file
     
    R. Robert Bell, Jul 8, 2004
    #2
  3. Court Myers

    Court Myers Guest

    Thank You, Thank You...

    Court Myers
     
    Court Myers, Jul 8, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.