tuantrinhdp Posted January 30, 2023 Share Posted January 30, 2023 Hi erveyone. Please help me write lisp convert block to point. test.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 30, 2023 Share Posted January 30, 2023 Are you after replacing blocks with point objects ? 1 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 30, 2023 Share Posted January 30, 2023 (defun c:Test (/ int sel ent get ) ;;----------------------------------------------------;; ;; Author : Tharwat Al Choufi ;; ;; website: https://autolispprograms.wordpress.com ;; ;;----------------------------------------------------;; (and (princ "\nSelect blocks to replace them with point objects : ") (setq int -1 sel (ssget "_:L" '((0 . "INSERT")))) (while (setq int (1+ int) ent (ssname sel int)) (and (setq get (entget ent)) (entmake (list '(0 . "POINT") (assoc 10 get) (assoc 8 get))) (entdel ent) ) ) ) (princ) ) 1 Quote Link to comment Share on other sites More sharing options...
tuantrinhdp Posted January 30, 2023 Author Share Posted January 30, 2023 3 minutes ago, Tharwat said: (defun c:Test (/ int sel ent get ) ;;----------------------------------------------------;; ;; Author : Tharwat Al Choufi ;; ;; website: https://autolispprograms.wordpress.com ;; ;;----------------------------------------------------;; (and (princ "\nSelect blocks to replace them with point objects : ") (setq int -1 sel (ssget "_:L" '((0 . "INSERT")))) (while (setq int (1+ int) ent (ssname sel int)) (and (setq get (entget ent)) (entmake (list '(0 . "POINT") (assoc 10 get) (assoc 8 get))) (entdel ent) ) ) ) (princ) ) Thank you so much. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 30, 2023 Share Posted January 30, 2023 You're welcome anytime. 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.