Tunnelrat Posted January 7, 2009 Share Posted January 7, 2009 I found this lisp code in this forum posted by fuccaro, he said it can be modified to have a nodes insert at Circles and Lines but I can't get it to work by adding (= zero "Line") Would anyone that know how to please help me and especially make it to work with blocks. Many many thanks. ; Draw POINTs at POLYLINE vertexes ; and at (M)TEXT insertion points ;;; mfuccaro@hotmail.com 09.06.2003 ; (defun c:pts( / ss i elist zero first) (setvar "CMDECHO" 0) (command "UNDO" "begin") (setq ss (ssget) i 0) (repeat (sslength ss) (setq elist (entget (ssname ss i)) zero (cdr (assoc 0 elist))) (if (OR (= zero "TEXT") (= zero "MTEXT") (= zero "LWPOLYLINE")) (while elist (setq first (car elist) elist (cdr elist)) (if (= 10 (car first)) (command "POINT" (cdr first))) )) (setq i (1+ i)) ) (command "undo" "end") (setvar "CMDECHO" 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
CarlB Posted January 7, 2009 Share Posted January 7, 2009 It seems it should have worked with "line", did you add it like this?: (if (OR (= zero "TEXT") (= zero "MTEXT") (= zero "LWPOLYLINE") (= zero "LINE")) to make it work with just blocks use this line; (if (= zero "INSERT") the entire file modified for just nodes on block inserts; ; Draw POINTs at BLOCK insert points ;;;; [email="mfuccaro@hotmail.com"]mfuccaro@hotmail.com[/email] 09.06.2003 ;;; modied by CAB 1.06.09 (defun c:pts ( / ss i elist InsPt) (setvar "CMDECHO" 0) (command "UNDO" "begin") (setq ss (ssget '((0 . "INSERT"))) i 0) ;filters for inserts (repeat (sslength ss) (setq elist (entget (ssname ss i)) (setq InsPt (cdr (assoc 10 elist))) (command "POINT" insPt) (setq i (1+ i)) ) (command "undo" "end") (setvar "CMDECHO" 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
Tunnelrat Posted January 7, 2009 Author Share Posted January 7, 2009 Thank you very much CarlB, it works perfect. It didn't work before, may be I had the PDnode set too small and it didn't show. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 7, 2009 Share Posted January 7, 2009 It seems it should have worked with "line", did you add it like this?: (if (OR (= zero "TEXT") (= zero "MTEXT") (= zero "LWPOLYLINE") (= zero "LINE")) to make it work with just blocks use this line; (if (= zero "INSERT") the entire file modified for just nodes on block inserts; ; Draw POINTs at BLOCK insert points ;;;; [email="mfuccaro@hotmail.com"]mfuccaro@hotmail.com[/email] 09.06.2003 ;;; modied by CAB 1.06.09 (defun c:pts ( / ss i elist InsPt) (setvar "CMDECHO" 0) (command "UNDO" "begin") (setq ss (ssget '((0 . "INSERT"))) i 0) ;filters for inserts (repeat (sslength ss) (setq elist (entget (ssname ss i)) (setq InsPt (cdr (assoc 10 elist))) (command "POINT" insPt) (setq i (1+ i)) ) (command "undo" "end") (setvar "CMDECHO" 1) (princ) ) 1 Bracket Missed ; Draw POINTs at BLOCK insert points ;;;; [email="mfuccaro@hotmail.com"]mfuccaro@hotmail.com[/email] 09.06.2003 ;;; modied by CAB 1.06.09 (defun c:pts ( / ss i elist InsPt) (setvar "CMDECHO" 0) (command "UNDO" "begin") (setq ss (ssget '((0 . "INSERT"))) i 0) ;filters for inserts (repeat (sslength ss) (setq elist (entget (ssname ss i))[b][color=Red])[/color][/b] (setq InsPt (cdr (assoc 10 elist))) (command "POINT" insPt) (setq i (1+ i)) ) (command "undo" "end") (setvar "CMDECHO" 1) (princ) ) 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.