Originally Posted by
Tom Beauford
The problem is probably your macro is canceling immediately after (load "dtlcallout.lsp") is called.
The ^c^c that's in new macros by default is to cancel existing commands. I've never seen it used a second time in a macro before.
Change the macro to ^c^c(load "dtlcallout.lsp");dtlcallout
Maybe you're able to load the routine locally without issue and his PC is taking longer because it's being loaded from the network or deeper down in his support path.
Hi Tom, That doesn't seem to be the issue. I had him change the macro, and it is still happening. We are both loading the file locally from our own computer. File path is C:\Program files\Autodesk\Autocad 2019\Support. We both have this path set up in our support file search path as the 2nd path in the list.
The error message he is getting:
Code:
Command: (load “dtlcallout.lsp”)
; error: bad argument type: stringp nil
Command: dtlcallout Unknown command "DTLCALLOUT". Press F1 for help.
Perhaps the lisp routine itself is faulty, but that doesn't explain why it works on my computer... Here is the lisp itself... Pretty basic, and I'm sure could be written more elegantly...
(defun c:dtlcallout () ;1stosmode 1stlayer CASS pt1 pt3 pt2 pt4 LL UL UR LR dtlpt dtlnum dtlnumstring HBW HBH BCP DAP BOXO
(setq 1stosmode nil 1stlayer nil CASS nil pt1 nil pt3 nil pt2 nil pt4 nil LL nil UL nil UR nil LR nil dtlpt nil dtlnum nil dtlnumstring nil HBW nil HBH nil BCP nil DAP nil BOXO nil)
(setq 1stosmode (getvar "osmode")) ;get current osmode setting
(setq 1stlayer (getvar "clayer")) ;get current layer setting
(setq CASS (getvar "cannoscalevalue")) ;get current annotative scale setting
(setq pt1 (getpoint "\nSelect first corner of detail\n")) ;ask 1st corner
(setq pt3 (getpoint "\nSelect opposite corner of detail\n")) ;ask opposite corner
(setq BOXO 6) ;sets box offset distance
(setvar "osmode" 0) ;set osmode to 0
(setq pt2 (list (car pt1) (cadr pt3))) ;sets 2nd corner
(setq pt4 (list (car pt3) (cadr pt1))) ;sets 4th corner
(if (and (< (car pt1) (car pt3)) (< (cadr pt1) (cadr pt3))) ;if pt1 @ LL
(setq LL pt1 UL pt2 UR pt3 LR pt4) ;then set LL,UL,UR,LR
(if (and (< (car pt1) (car pt3)) (> (cadr pt1) (cadr pt3))) ;if pt1 @ UL
(setq UL pt1 UR pt4 LR pt3 LL pt2) ;then set LL,UL,UR,LR
(if (and (> (car pt1) (car pt3)) (> (cadr pt1) (cadr pt3))) ;if pt1 @ UR
(setq UR pt1 LR pt2 LL pt3 UL pt4) ;then set LL,UL,UR,LR
(if (and (> (car pt1) (car pt3)) (< (cadr pt1) (cadr pt3))) ;if pt1 @ LR
(setq LR pt1 LL pt4 UL pt3 UR pt2) ;then set LL,UL,UR,LR
(alert "LLpositionerror")
)
)
)
) ;end if
(setq LL (list (- (car LL) BOXO) (- (cadr LL) BOXO))) ;changes LL to -BOXO,-BOXO
(setq UL (list (- (car UL) BOXO) (+ (cadr UL) BOXO))) ;changes UL to -BOXO,+BOXO
(setq UR (list (+ (car UR) BOXO) (+ (cadr UR) BOXO))) ;changes UR to +BOXO,+BOXO
(setq LR (list (+ (car LR) BOXO) (- (cadr LR) BOXO))) ;changes LR to +BOXO,-BOXO
(setq HBW (* (distance LL LR) 0.5)) ;sets box half width
(setq HBH (* (distance LL UL) 0.5)) ;sets box half height
(setq BCP (list (+ (car LL) HBW) (+ (cadr LL) HBH))) ;sets center point of box
(setq dtlpt (getpoint "\nSelect detail note placement\n")) ;ask detail location
(if (and (< (car dtlpt) (car BCP)) (< (cadr dtlpt) (cadr BCP))) ;if dtlpt is LL of box center point
(setq DAP LL) ;then set detail arrow point to LL
(if (and (< (car dtlpt) (car BCP)) (> (cadr dtlpt) (cadr BCP))) ;if dtlpt is UL of box center point
(setq DAP UL) ;then set detail arrow point to UL
(if (and (> (car dtlpt) (car BCP)) (> (cadr dtlpt) (cadr BCP))) ;if dtlpt is UR of box center point
(setq DAP UR) ;then set detail arrow point to UR
(if (and (> (car dtlpt) (car BCP)) (< (cadr dtlpt) (cadr BCP))) ;if dtlpt is LR of box center point
(setq DAP LR) ;then set detail arrow point to LR
(alert "finddetaillocation error") ;else error
) ;end if
) ;end if
) ;end if
) ;end if
(setq dtlnum (getstring 2 "What detail number?")) ;ask detail number
(setq dtlnumstring (strcat "DETAIL #" dtlnum)) ;string concatenate "DETAIL #" & detail number
(setvar "clayer" "4-dimension") ;set current layer to dimension
(command "rectangle" LL UR) ;draws detail callout rectangle
(command "chprop" "l" "" "lt" "phantom2" "") ;change properties of last object to linetype phantom2
(command "mleader" DAP dtlpt "" dtlnumstring) ;create multi leader starting at DAP, ending at dtlpt & entering detailnumstring
(setvar "osmode" 1stosmode) ;reverts to original osmode
(setvar "clayer" 1stlayer) ;reverts to original layer
(princ)
)
Thanks for your help!