你好,cad专家。
如何从附着的图像快速创建多个视图?
我有一个lisp例程,可以创建视图,但无法将ucs与创建的矩形对齐。
我的Lisp程序是。。。。
- (Defun C:views ()
- (Terpri)
- (Setq Numero (getint "Starting Number > "))
- (Setq Sair 0)
- (Terpri)
- (Setq txt (getstring "txt > "))
- (While (/= Sair T)
- (Setq Cont 0)
- (Terpri)
- (Setq Janela (car(entsel "Select view > ")))
- (Setq Janela (entget Janela))
- (Setq Tamanho (length Janela))
- (Setq X1 nil)
- (Setq X2 nil)
- (Setq Y1 nil)
- (Setq Y2 nil)
- (Setq X nil)
- (Setq Y nil)
- (While (< Cont Tamanho)
- (Setq Contagem (car(nth Cont Janela)))
- (If (= Contagem 10)
- (Progn
- (Setq X (cadr (nth Cont Janela)))
- (Setq Y (caddr(nth Cont Janela)))
- (If (= X1 nil)
- (Progn
- (Setq X1 X)
- )
- )
- (If (= Y1 nil)
- (Progn
- (Setq Y1 Y)
- )
- )
- ;************************************
- (If (> X X1)
- (Progn
- (Setq X2 X)
- )
- )
- (If (< X X1)
- (Progn
- (Setq X1 X2)
- (Setq X1 X)
- )
- )
- ;************************************
- (If (> Y Y1)
- (Progn
- (Setq Y2 Y)
- )
- )
- (If (< Y Y1)
- (Progn
- (Setq Y2 Y1)
- (Setq Y1 Y)
- )
- )
- ;************************************
- )
- )
- (Setq Cont (1+ Cont))
- )
- (If (< Numero 10)
- (Progn
- (Setq Numero (itoa Numero))
- (Setq Numero (strcat "0" Numero))
- )
- (Progn
- (Setq Numero (itoa Numero))
- )
- )
- (Setq X (list X1 Y1))
- (Setq Y (list X2 Y2))
- (Command "-View")
- (Command "W")
- (Command (strcat txt " " Numero))
- (Command X)
- (Command Y)
- (Setq Numero (atoi Numero))
- (Setq Numero (1+ Numero))
- )
- )
|