我无法测试这一点,因为我没有障碍,但它可能会为您指明正确的方向:
- (defun c:ARW ( / *error* vl ov f p d )
- ;; © Lee Mac 2010
- (defun *error* ( msg )
- (and ov (mapcar 'setvar vl ov))
- (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
- (princ (strcat "\n** Error: " msg " **")))
- (princ)
- )
- (setq vl '("CLAYER" "CMDECHO" "OSMODE") ov (mapcar 'getvar vl))
- (if (and
- (setq f
- (findfile
- (strcat "PR"
- (apply 'strcat
- (mapcar
- (function
- (lambda ( foo str init )
- (and init (initget 1 init)) ((eval foo) str)
- )
- )
- '(getkword getkword getkword)
- '("\nSpecify Type [89/90/91/92] : "
- "\nSpecify Material [s/B] : "
- "\nSpecify Colour [R/W/A/G] : "
- )
- '("89 90 91 92" "S B" "R W A G")
- )
- )
- "-AR.dwg"
- )
- )
- )
- (setq p (getpoint "\nSpecify Insertion Point: "))
- (setq d (getangle "\nSpecify Direction: " p))
- (mapcar 'setvar (cdr vl) '(0 0))
-
- (or (tblsearch "LAYER" "PBFACE")
- (not (command "_.-layer" "_M" "PBFACE" ""))
- )
- (setvar 'CLAYER "PBFACE")
- )
- (command "_.-insert" f "_non" (polar p (/ pi 2.) 4.125) "" "" (- (* 180. (/ d pi)) 90.))
- )
- (mapcar 'setvar vl ov)
- (princ)
- )
-
|