舱口顶部的挡块
知道舱口上方是否有障碍物的最简单方法是什么我有以下代码
(setq selec33 (ssget "_WP" lis_coords
(list
(cons 0"HATCH")
(cons 8"H1,H2,H3")
)
)
)
(setq b 0)
(if (not (equalselec33 nil))
(progn
(repeat (sslength selec33)
(setq entblk33 (ssname selec33 b))
(setq lis_ent33x (entget entblk33))
(setq nomeblk33 (cdr(assoc 8 (entget entblk33))))
(setq valor_hatch (vla-get-area (vlax-ename->vla-object entblk33)))
..................
(So far the code works, I got the hatch)
..................
(NEW! I need to check if there is a block on this hatch , the block name is TESTER. If it is over this hatch sending an alert and continue code)
..................
(setq b (+ b 1))
)
))
图像示例(图案填充绿色上的块) 对于仅包含线段的图案填充边界,请尝试此操作。
(setq EL (entlast))
(vl-cmdf "_-hatchedit" entblk33 "_B" "_P" "_N")
(if (/= EL (entlast) (setq bnd (entlast)))
(progn
(mapcar
'(lambda (x)
(if (eq (car x) 10)
(setq Lv (cons (list (cadr x) (caddr x)) Lv))
)
)
(entget bnd)
)
(entdel bnd)
(if
(or
(ssget "_F" Lv (list '(0 . "INSERT")(cons 2 "TESTER")))
(ssget "_WP" Lv (list '(0 . "INSERT")(cons 2 "TESTER")))
)
(alert "The block TESTER is on the hatch.")
)
)
)
页:
[1]