BIGAL Posted October 15, 2015 Posted October 15, 2015 (edited) Todays wish list I will rewrite this and Offset was next to add, nearly posted last night it does not work at this stage. A light turned on once over this current problem, what about Line L100 d345 r100 c a rectang appears move© same thing. Up Down left Right ; Enter the filet radius as part of a command line entry f100 offset O234 circle c123-45 ; 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 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) (setq pt (getpoint "pick centre pt")) (vla-sendcommand fillet-reactor-acdoc "_.Circle !pt ") ) ) ) (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) ) ) ; master cond ) ; defun (princ) (or fillet-reactor-acdoc (setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object))) ) (princ) Edited October 28, 2015 by BIGAL Quote
BIGAL Posted October 15, 2015 Posted October 15, 2015 (edited) Code corrected just moved the translate so simple some times this will do a fillet or a circle f100 C234 you just press enter after pick circle point. Changed code above again now has circle offset and fillet. Check "_.Offset " two spaces required. Watch this space left right down up. Without your help Lee would not have got there, started using it today for fillets and its so easy. Edited October 15, 2015 by BIGAL Quote
Lee Mac Posted October 15, 2015 Posted October 15, 2015 Good stuff BIGAL - looks like you're having fun with it! Quote
BIGAL Posted October 28, 2015 Posted October 28, 2015 Circle code corrected for pick point, code above updated. Quote
zaphod Posted October 29, 2015 Posted October 29, 2015 :Dnice code, I could see it helping a lot of people save time, to spend more time lurking here Quote
BIGAL Posted October 30, 2015 Posted October 30, 2015 Were starting to use it and its surprising how you get used to using the - for decimal, did something the other day lots of fillets at odd radius. Quote
broncos15 Posted December 23, 2015 Author Posted December 23, 2015 So I have been looking at Big Al's and Lee's codes, which are both brilliant by the way to practice my reactor skills. I know that you cannot use commands within a reactor, so I am curious why can you use vla-send command? Is it because vla-send command acts almost like a script that sends something to the command line, or is it for some different reason? Quote
broncos15 Posted June 15, 2017 Author Posted June 15, 2017 I was curious if there was a way with my offset reactor to have it launch one of two commands. I ask because I have an offset from xref LISP I use as well as the normal offset command and I'd like the reactor to work with the offset from xref LISP. Quote
BIGAL Posted June 16, 2017 Posted June 16, 2017 I was playing with the code to do something new and you should be able to do the xref lisp you may need to write a script file with something like (xrefoff 23) in the script. I had it working with a script but removed once I figured out where I was wrong in code. You can run lisp code in a script file. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.