消隐、遮罩 基础程序
(defun c:tt (/ s1 i a1 txt pt1 txtbox x y pt2 pt3);高程点消隐(princ "\n请选择高程点:")
(setq s1 (ssget'((0 . "INSERT")(2 . "gc200"))))
(if s1
(progn
(setq i -1)
(repeat(sslength s1)
(setq a1 (ssname s1 (setq i(1+ i))))
(setq txt (entnext a1))
(setq txt (entget txt))
(if (= (cdr (assoc 0 txt)) "ATTRIB")
(progn
(setq pt1 (cdr (assoc 10 txt)))
(setq pt1 (list (car pt1) (cadr pt1)))
(setq txtbox (textbox txt))
(setq txtbox (cdr txtbox))
(setq txtbox (car txtbox))
(setq x (car txtbox))
(setq y (cadr txtbox))
(setq pt1 (polar pt1 (* 1.25 pi) 0.1414))
(setq pt2 (polar pt1 0.0 (+ x 0.2)))
(setq pt3 (polar pt2 (* 0.5 pi) (+ y 0.2)))
(setq pt4 (polar pt1 (* 0.5 pi) (+ y 0.2)))
(command "_wipeout" "f" "off")
(command "wipeout" pt1 pt2 pt3 pt4 "c")
(command "draworder" s1 "" "f")
)
(print "你选择的高程点没有属性!")
)
)
)
)
(prin1)
)
;==============================================================
(defun c:tt1 (/ s1 i a1 txt pt1 txtbox x y pt2 pt3);文字消隐
(princ "\n请选择文字:")
(if(setq s1 (ssget'((0 . "text"))))
(progn
(setq i -1)
(repeat(sslength s1)
(setq e(ssname s1(setq i(1+ i))))
(setq txt (entget e))
(setq pt1 (cdr (assoc 10 txt)))
(setq pt1 (list (car pt1) (cadr pt1)))
(setq txtbox (textbox txt))
(setq txtbox (cdr txtbox))
(setq txtbox (car txtbox))
(setq x (car txtbox))
(setq y (cadr txtbox))
(setq pt1 (polar pt1 (* 1.25 pi) 0.1414))
(setq pt2 (polar pt1 0.0 (+ x 0.2)))
(setq pt3 (polar pt2 (* 0.5 pi) (+ y 0.2)))
(setq pt4 (polar pt1 (* 0.5 pi) (+ y 0.2)))
(command "_wipeout" "f" "off")
(command "wipeout" pt1 pt2 pt3 pt4 "c")
(command "draworder" s1 "" "f")
)
)
)
(prin1)
)
;==============================================================块消隐
(defun c:tt2 (/ s1 i e pt1 pt2 pt3 pt4)
(princ "\n请选择图块:")
(if(setq s1(ssget'((0 . "INSERT")(8 . "dldw"))))
(progn
(setq i -1)
(repeat(sslength s1)
(Setq e(ssname s1(setq i(1+ i))))
(vla-getboundingbox (vlax-ename->vla-object e) 'pt1 'pt2)
(setq
pt1(vlax-safearray->list pt1)
pt2 (vlax-safearray->list pt2)
)
(setq pt1(list(car pt1)(cadr pt1)))
(setq pt2(list(car pt2)(cadr pt2)))
(setq pt3(list(car pt1)(cadr pt2)))
(setq pt4(list(car pt2)(cadr pt1)))
(if(< 1(sslength(ssget "_CP" (list pt1 pt3 pt2 pt4))))
(progn
(command "_wipeout" "f" "off")
(command "wipeout" "_non" pt1"_non" pt3 "_non" pt2 "_non" pt4 "c")
(command "draworder" s1 "" "f")
)
)
)
)
)
(prin1)
)
;===================================================================综合消隐
(defun c:tt4 (/ s1 i e pt1 pt2 pt3 pt4)
(princ "\n请选择图块:")
(if(setq s1(ssget '((0 . "~*line"))))
(progn
(setq i -1)
(repeat(sslength s1)
(Setq e(ssname s1(setq i(1+ i))))
(vla-getboundingbox (vlax-ename->vla-object e) 'pt1 'pt2)
(setq
pt1(vlax-safearray->list pt1)
pt2 (vlax-safearray->list pt2)
)
(setq pt1(list(-(car pt1)0.3)(-(cadr pt1)0.3)))
(setq pt2(list(+(car pt2)0.3)(+(cadr pt2)0.3)))
(setq pt3(list(car pt1)(cadr pt2)))
(setq pt4(list(car pt2)(cadr pt1)))
(if(< 1(sslength(ssget "_CP" (list pt1 pt3 pt2 pt4))))
(progn
(command "_wipeout" "f" "off")
(command "wipeout" "_non" pt1"_non" pt3 "_non" pt2 "_non" pt4 "c")
(command "draworder" E "" "f")
)
)
)
)
)
(prin1)
)
谢谢楼主分享!!! 谢谢楼主分享!!! 楼主,有动图么?我加载后 ,没反应啊
页:
[1]