Jump to content

Node at insertion of a block


Tunnelrat

Recommended Posts

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)

)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :P

 

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

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