;;;修改 文本、属性块、尺寸 (defun c:SZ (/ e1) (setvar "cmdecho" 0)(setvar "pickbox" 21) (setq e1 (entget (car (setq s1 (entsel "选择编辑对象:"))))) (if (= (cdr (assoc 0 e1)) "TEXT") (command "DDEDIT" s1)) (if (= (cdr (assoc 0 e1)) "MTEXT") (command "DDEDIT" s1)) (if (= (cdr (assoc 0 e1)) "INSERT") (command "DDATTE" s1))(princ))
我只想达到这样的目的: (setq e1 (entsel "\n请选择需要编辑的文本、属性块、尺寸:")) 如果选择的对象为文本,则(command "DDATTE" ); 如果选择的对象为块,则(command "DDATTE" ); 这个程序谁能帮忙加个尺寸类型的选择啊, 就是说如果我选择的类型是“尺寸”哦: '((0 . "DIMENSION"))
那么我就执行以下这些代码: (defun TDZ (/ e1 ds) (SETQ DS (getstring (strcat "\n 输入替代值:" ))) (if (= DS nil ) (command "dim1" "new" (strcat DS "<>{}{}") e1 "")) (if (/= DS nil ) (command "dim1" "new" (strcat DS "{}{}") e1 "")) (princ)) |