现在试试这个,让我知道。
- (defun c:IBlock (/ os dcl_id plan side front b1 b2 bk)
- ;; Modified by Tharwat 10.12.2014 ;;
- (setq dcl_id (load_dialog "c:\\Lisp\\Programs\\Iblock.dcl"))
- (if (not (new_dialog "IBlock" dcl_id))
- (exit)
- (progn
- (action_tile "cancel" "(setq ddiag 1)(done_dialog)")
- (action_tile
- "accept"
- "(setq plan (atoi (get_tile "plan"))
- side (atoi (get_tile "side"))
- front (atoi (get_tile "front"))
- b1 (atoi (get_tile "B1"))
- b2 (atoi (get_tile "B2")))
- (done_dialog)"
- )
- (start_dialog)
- (unload_dialog dcl_id)
- )
- )
- (if (= ddiag 1)
- (princ "\n ...IBblock Cancelled. \n ")
- (progn
- (cond ((and (= plan 1)
- (= b1 1)
- )
- (setq bk "Block1p")
- )
- ((and (= plan 1)
- (= b2 1)
- )
- (setq bk "Block2p")
- )
- ((and (= side 1) (= b1 1))
- (setq bk "Block1s")
- )
- ((and (= side 1) (= b2 1))
- (setq bk "Block2s")
- )
- ((and (= front 1) (= b1 1))
- (setq bk "Block1f")
- )
- ((and (= front 1) (= b2 1))
- (setq bk "Block2f")
- )
- )
- (if (and bk (findfile (setq bk (strcat "c:\\Lisp\\Library\" bk ".dwg"))))
- (progn
- (setq os (getvar "osmode"))
- (setvar "osmode" 0)
- (command "_.-insert" bk pause 1. 1. pause)
- (setvar "osmode" os)
- )
- (alert
- (strcat "\n Name of Block < " bk " > is not found !!")
- )
- )
- )
- )
- (princ)
- )
|