rodrigo_sjc_sp Posted September 26, 2013 Posted September 26, 2013 What is the simplest way to know if there is a block over a hatch I have the following code (setq selec33 (ssget "_WP" lis_coords (list (cons 0 "HATCH") (cons 8 "H1,H2,H3") ) ) ) (setq b 0) (if (not (equal selec33 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)) ) )) Quote
rodrigo_sjc_sp Posted September 26, 2013 Author Posted September 26, 2013 image sample ( block over hatch green ) Quote
GP_ Posted September 27, 2013 Posted September 27, 2013 Try this, for hatch boundaries containing segments only. (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.") ) ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.