- 积分
- 30207
- 明经币
- 个
- 注册时间
- 2019-11-19
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2023-8-16 12:56:04
|
显示全部楼层
没啥好处,纯体力活呀
(defun C:NM (/ ss xj-en2pt zuhelst)
(defun xj-en2pt (e / s)
(if (and e (setq tp (type e))
(atom e)
(or (= tp 'vla-object)
(and (= tp 'ename)(setq e (vlax-ename->vla-object e)))
)
)
(progn
(vla-GetBoundingBox e 'a 'b)
(mapcar 'vlax-safearray->list (list a b)) ;输出左下角和右上角坐标
)
)
)
(setq ss (ssget ":S"(list '(0 . "*line")'(8 . "E-WIRE-FIRE-CIRC-MCNT,E-WIRE-FIRE,E-WIRE-FIRE-CIRC-BRDT,E-WIRE-FIRE-CIRC-TELP,E-WIRE-MCNT,E-WIRE-消防手动,E-WIRE-CCTR,E-WIRE-FIRE-T+P"))))
(setq zuhelst '(("E-WIRE-CCTR" "WDZN-RYJS-2x1.0-SC16") ("E-WIRE-MCNT" "WDZN-RYJS-2x1.5 -SC16") ("E-WIRE-消防手动" "WDZN-RYJS-2*1.0-SC16+WDZN-RYJS-2*1.5-SC16") ("E-WIRE-FIRE-CIRC-TELP" "WDZNRVVP-2x1.0-SC16") ("E-WIRE-FIRE-CIRC-BRDT" "WDZN-BYJ-2x1.5-SC16") ("E-WIRE-FIRE-T+P" "WDZN-RYJS-2X1.5-SC16+WDZN-BYJ-2X2.5-SC16") ("E-WIRE-FIRE-CIRC-MCNT" "WDZN-RYJS-2X1.5-SC16+WDZN-BYJ-2X2.5-SC16") ("E-WIRE-FIRE" "WDZN-RYJS-2X1.5-SC16")))
(mapcar '(lambda(a)
(setq tc(cdr(assoc 8 (entget a))))
(setq p1(cadr(xj-en2pt a))
p2(polar p1 0 8000)
)
(setq str
(cadr(car(vl-remove-if-not '(lambda(x)(member tc x)) zuhelst)))
)
(entmake (list '(0 . "TEXT")'(41 . 0.35) (cons 1 str)(cons 50 0) (cons 10 p2) (cons 11 p2) (cons 72 0) (cons 73 2) (cons 40 600)))
)
(vl-remove-if-not '(lambda(x)(= 'ENAME (type x))) (mapcar 'cadr (ssnamex ss)))
)
(princ)
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|