_忽略语言更改
. 忽略重新定义的命令
-发出命令的命令行版本(如果可用)
实际上,这可能更适合你。。。
- (defun _InsertBlock (block x y r / x y r)
- ;; block - name of block
- ;; x - X scale for block (nil for on-screen prompt)
- ;; y - Y scale for block (nil for on-screen prompt)
- ;; r - rotation of block (nil for on-screen prompt) [MUST BE IN RADIANS]
- ;; Alan J. Thompson, 07.19.10
- (if (or (tblsearch "BLOCK" block) (findfile (strcat block ".DWG")))
- (if (and (or x
- (setq x (cond ((getdist "\nSpecify X value <1.0>: "))
- (1.)
- )
- )
- )
- (or y
- (setq y (cond ((getdist (strcat "\nSpecify Y value <" (rtos x) ">: ")))
- (x)
- )
- )
- )
- )
- (progn
- (command "_.-insert" block "_X" x "_Y" y)
- (and r (command "_r" (angtos r)))
- )
- )
- (alert (strcat "Block: "" block "" cannot be found!"))
- )
- (princ)
- )
- (defun c:Test1 (/) (_InsertBlock "P6" nil nil nil) (princ))
- (defun c:TEst2 (/) (_InsertBlock "P6" 1. 1. nil) (princ))
- (defun c:TEst3 (/) (_InsertBlock "P6" nil nil pi) (princ))
|