Jump to content

draw point in each block base point


fathihvac

Recommended Posts

(defun c:makeblkinspoints ( / ss ch i ent bpocs bpw )
 (vl-load-com)
 (prompt "\nSelect INSERT block entities...")
 (while (null ss)
   (setq ss (ssget '((0 . "INSERT"))))
   (if (null ss) (prompt "\nEmpty sel. set... Try selecting again..."))
 )
 (initget "Xref Block")
 (setq ch (getkword "\nOperate on [Xref/Block]s <Both> : "))
 (cond
   ( (eq ch nil)
     (repeat (setq i (sslength ss))
       (setq ent (ssname ss (setq i (1- i))))
       (setq bpocs (cdr (assoc 10 (entget ent))))
       (setq bpw (trans bpocs ent 0))
       (entmake (list '(0 . "POINT") (cons 10 bpw)))
     )
   )
   ( (eq ch "Xref")
     (repeat (setq i (sslength ss))
       (setq ent (ssname ss (setq i (1- i))))
       (if (eq (vla-get-isxref (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (cdr (assoc 2 (entget ent))))) :vlax-true)
         (progn
           (setq bpocs (cdr (assoc 10 (entget ent))))
           (setq bpw (trans bpocs ent 0))
           (entmake (list '(0 . "POINT") (cons 10 bpw)))
         )
       )
     )
   )
   ( (eq ch "Block")
     (repeat (setq i (sslength ss))
       (setq ent (ssname ss (setq i (1- i))))
       (if (eq (vla-get-isxref (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (cdr (assoc 2 (entget ent))))) :vlax-false)
         (progn
           (setq bpocs (cdr (assoc 10 (entget ent))))
           (setq bpw (trans bpocs ent 0))
           (entmake (list '(0 . "POINT") (cons 10 bpw)))
         )
       )
     )
   )
 )
 (princ)
)

 

HTH, M.R.

Link to comment
Share on other sites

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