Jump to content

Block on top of hatch


Recommended Posts

Posted

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))
   )
  ))

Posted

screen_hatch.jpg

 

image sample ( block over hatch green )

Posted

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.")
           )
       )
   )

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...