我用LISP写了一写扩展数据的程序,但运行起来相当慢(慢得不可忍受),请那位大侠帮我改编成VBA,谢谢了!
源代码如下:
(defun stbm (s0 db / ss sss b c) (setq ss (entget (ssname s0 0)(list "SOUTH"))) (setq sss (ssname s0 0)) (cond ((= db "a") (setq b '(("SOUTH" (1000 . "202101")))) (setq c '("SOUTH" (1000 . "202101"))) )
((= db "ad") (setq b '(("SOUTH" (1000 . "202111")))) (setq c '("SOUTH" (1000 . "202111"))) ) ) (setq ss (subst (cons -3 b) (assoc -3 ss) ss)) (regapp "SOUTH") (setq ss (append ss (list (cons '-3 (list c))))) (entmod ss) (entupd sss) (setq s0 nil) ) (defun c:SSD (/ zdx0 zdx s0) (command "insert" "gc200" (list y x h) 1.0 1.0 0) (setq s0 (ssget "X" '((2 . "GC200")))) (stbm s0 "a") (command "text" (list (+ y 0.5) (- x 0.75)) "2.0" "0" h) (setq s0 (ssget "X" '((0 . "TEXT"))))(stbm s0 "ad") )