- 积分
- 26525
- 明经币
- 个
- 注册时间
- 2003-8-26
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2012-3-11 11:45:49
|
显示全部楼层
一个类似作用的
;;; ======================================
;;; 名称: 尺寸检查
;;; 功能:尺寸起末点不在线端点数值显示红色
;;; ======================================
(defun c:aa (/ ent i lst name p ss ss0 x)
(defun zz002 (pt lst / p x)
(setq p nil)
(foreach x lst (if (and (= (car x) (car pt)) (= (cadr x) (cadr pt)))(setq p t))) p
)
(setvar "cmdecho" 0)
(vl-load-com)
(setq lst '() p t)
(if (setq ss0 (ssget "X" '((0 . "DIMENSION"))))
(repeat (setq i (sslength ss0))
(setq name (ssname ss0 (setq i (1- i))))
(if (= (vla-get-textcolor (vlax-ename->vla-object name)) 1)(progn (vlax-put-property (vlax-ename->vla-object name) "textcolor" 256) (setq p nil))))
)
(if p
(progn
(if (setq ss (ssget "X" '((0 . "LWPOLYLINE,LINE,ARC,CIRCLE,PLINE"))))
(repeat (setq i (sslength ss))
(setq name (ssname ss (setq i (1- i))) ent (entget name) type (cdr (assoc 0 ent)))
(cond
((member type '("PLINE" "LWPOLYLINE"))
(foreach x ent (if (= (car x) 10) (setq lst (cons (cdr x) lst)))))
(t (setq lst (cons (cdr (assoc 10 ent)) lst))
(if (= type "LINE")(setq lst (cons (cdr (assoc 11 ent)) lst)))
(if (= type "ARC")
(setq lst (cons (polar (cdr (assoc 10 ent)) (cdr (assoc 50 ent)) (cdr (assoc 40 ent))) lst)
lst (cons (polar (cdr (assoc 10 ent)) (cdr (assoc 51 ent)) (cdr (assoc 40 ent))) lst))
)))
))
(if (setq ss (ssget "X" '((0 . "DIMENSION"))))
(repeat (setq i (sslength ss))
(setq name (ssname ss (setq i (1- i))) ent (entget name))
(if (and (zz002 (cdr (assoc 13 ent)) lst) (zz002 (cdr (assoc 14 ent)) lst))
(princ)
(vlax-put-property (vlax-ename->vla-object name) "textcolor" 1)
)
)
)
)
)
(princ)
)
|
评分
-
查看全部评分
|