fathihvac Posted October 13, 2014 Share Posted October 13, 2014 Hello, Need lisp to draw point in block base point so i can hide these blocks and use the drawen point to some purpose. Sorry for my poor english. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted October 13, 2014 Share Posted October 13, 2014 (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. Quote Link to comment Share on other sites More sharing options...
fathihvac Posted October 14, 2014 Author Share Posted October 14, 2014 Thank you very much it works perfect Quote Link to comment Share on other sites More sharing options...
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.