You can make a reactor that looks at the error that has occured so if you type U5000 it will pan 5000 up. I made these as quicky functions for fillet and circle F123 does a fillet of 123 C100 does a circle with radius 100 type any number following the character "key". It is advanced coding and I had to get some help developing it.
Here is some sample code you can make the 4 options U L R D if you get stuck just ask here. Not sure if only 2 needed U and R with -value being an option would need to test.
Code:
; Enter the filet radius as part of a command line entry f100, offset O234, circle c123-45, P123 for pline width
; note - is used for decimal point
; original code and methology by Alan H
; assistance and code that worked by Lee-Mac
; OCT 2015
( (lambda nil
(vl-load-com)
(foreach obj (cdar (vlr-reactors :vlr-command-reactor))
(if (= "fillet-reactor" (vlr-data obj))
(vlr-remove obj)
)
)
(vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback)))
)
)
(defun plwid ( / width oldwidth)
(setq width (distof (substr com 2) 2))
(setq oldwidth (getvar 'plinewid))
(if (<= 0.0 width)
(progn
(setvar 'plinewid width )
(vla-sendcommand fillet-reactor-acdoc "_.pline ")
(setvar 'plinewid oldwidth)
)
)
)
(defun filletrad ( / rad)
(setq rad (distof (substr com 2) 2))
(if (<= 0.0 rad)
(progn
(setvar 'filletrad rad)
(vla-sendcommand fillet-reactor-acdoc "_.fillet ")
)
)
)
(defun makecirc ( / rad)
(setq rad (distof (substr com 2) 2))
(if (<= 0.0 rad)
(progn
(setvar 'circlerad rad)
(vla-sendcommand fillet-reactor-acdoc "_.Circle ")
)
)
)
(defun offdist ( / dist)
(setq dist (distof (substr com 2) 2))
(if (<= 0.0 dist)
(progn
(setvar 'offsetdist dist)
(vla-sendcommand fillet-reactor-acdoc "_.Offset ")
)
)
)
(defun fillet-reactor-callback ( obj com )
(setq com (vl-string-translate "-" "." (strcase (car com))))
(cond
( (and
(wcmatch com "~*[~F.0-9]*")
(wcmatch com "F*")
(wcmatch com "~F*F*")
(wcmatch com "~*.*.*")
) ; and
(filletrad)
)
( (and
(wcmatch com "~*[~C.0-9]*")
(wcmatch com "C*")
(wcmatch com "~C*C*")
(wcmatch com "~*.*.*")
) ;and
(makecirc)
)
( (and
(wcmatch com "~*[~O.0-9]*")
(wcmatch com "O*")
(wcmatch com "~O*O*")
(wcmatch com "~*.*.*")
) ; and
(offdist)
)
( (and
(wcmatch com "~*[~P.0-9]*")
(wcmatch com "P*")
(wcmatch com "~P*P*")
(wcmatch com "~*.*.*")
) ; and
(plwid)
)
) ; master cond
) ; defun
(princ)
(or fillet-reactor-acdoc
(setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)
(princ)
; next Point or option keyword required.
Code:
^c^c-pan 0,0 (list 0 (getvar 'userr1))