;;防止错选;
(defun c:zj (/ sel typ nth38 nth32 condition)
(setvar "cmdecho" 0)
(setq condition 0);虚拟一个变量作为循环终止条件;
(while (= condition 0)
(progn
(setq sel (entsel "\n选择要加φ的尺寸:"))
(if (= sel nil) (princ);如果没有选择倒回去再选;
(progn
(setq typ (cdr(assoc 0 (entget(car sel)))))
(if (= typ "DIMENSION") (progn
(setq nth38 (cdr(nth 38 (entget(car sel)))))
(setq nth32 (cdr(nth 32 (entget(car sel)))));筛选出标注;
);注意:当标注与对象关联时原始数据为38项,当没有关联时原始数据为32项;
)
(if (or (= nth38 "AcDbRotatedDimension") (= nth32 "AcDbRotatedDimension"));OR是或者的意思,两个有一个成立即可
(setq condition 1)
);当选择到转角时设置虚拟变量condition=1
)
)
)
)
(command "dimoverride" "dimpost" "%%c<>" "" sel "")
(setvar "cmdecho" 1)
(princ)
) |