106
1万
101
顶梁支柱
使用道具 举报
10
40
30
初露锋芒
(defun jobs ()(STARTAPP (strcat "EXPLORER /e," "F:\\Jobs")))
; 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 (= "openx" (vlr-data obj)) (vlr-remove obj) ) ) (vlr-command-reactor "openx" '((:vlr-unknowncommand . openx-callback))) ))(defun openx ( obj com )(setq com (vl-string-translate "-" "." (strcase (car com)))) (cond ( (and (wcmatch com "~*[~B.0-9]*") (wcmatch com "B*") (wcmatch com "~B*B*") (wcmatch com "~*.*.*") ) ; and (openx) ) ) ; master cond) ; defun(STARTAPP (strcat "EXPLORER /e," "F:\\Jobs\\B16000\\B16007\\Drawings")))(princ)
( (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))) )); open a project that is 3 directory deep just by project number ; my example c:\2016 projects\2016123\design(defun openx ( / Proj) (setq projno (strcat "EXPLORER C:\" (substr com 2 4) " Projects\" (substr com 2) "\\Design\")) (vla-sendcommand fillet-reactor-acdoc (STARTAPP projno)) ); calls the fillet command with the radius f123(defun filletrad ( / rad)(setq rad (distof (substr com 2) 2)) (if (<= 0.0 rad) (progn (setvar 'filletrad rad) (vla-sendcommand fillet-reactor-acdoc "_.fillet ") ) ) );calls the circle command with radius c123(defun makecirc ( / rad radd)(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 ") ) ));calls offset with a distance + or - for left and right O123(defun offdist ( / dist)(setq dist (distof (substr com 2) 2)) (if (<= 0.0 dist) (progn (setvar 'offsetdist dist) (vla-sendcommand fillet-reactor-acdoc "_.Offset ") ) )); calls a lisp program(defun pipeoff ( / dist)(setq dist (distof (substr com 2) 2)) (if (<= 0.0 dist) (progn (setq poff (strcat "P" (rtos dist 2 0))) (if (not poff)(load "Pipe offsets")) (vla-sendcommand fillet-reactor-acdoc poff) ) )); start of call back F O P D as 1st character(defun fillet-reactor-callback ( obj com )(setq com (vl-string-translate "-" "." (strcase (car com)))) (cond ; open explorer ( (and (wcmatch com "~*[~D.0-9]*") (wcmatch com "D*") (wcmatch com "~D*D*") (wcmatch com "~*.*.*") ) ; and (openx) ); fillet ( (and (wcmatch com "~*[~F.0-9]*") (wcmatch com "F*") (wcmatch com "~F*F*") (wcmatch com "~*.*.*") ) ; and (filletrad) ) ; circle ( (and (wcmatch com "~*[~C.0-9]*") (wcmatch com "C*") (wcmatch com "~C*C*") (wcmatch com "~*.*.*") ) ;and (makecirc) ); offset ( (and (wcmatch com "~*[~O.0-9]*") (wcmatch com "O*") (wcmatch com "~O*O*") (wcmatch com "~*.*.*") ) ; and (offdist) ); pipe ( (and (wcmatch com "~*[~P.0-9]*") (wcmatch com "P*") (wcmatch com "~P*P*") (wcmatch com "~*.*.*") ) ; and (pipeoff)