Jump to content

Recommended Posts

Posted

(defun c:nod()

(command "setvar" "osmode" 1)

(setq ss (ssget "x" (list (cons 2 "NODE"))))

(setq len (sslength ss))

(setq key 0)

(repeat len

(setq ssn (ssname ss key))

(setq ins1 (cdr (assoc 10 (entget ssn))))

(command "zoom" "c" ins1 3000)

(command "move" ssn "" ins1 pause)

(setq key (+ 1 key))

 

)

)

Posted

prakash:

 

Attaching your question to this post was not a good idea. Anyone reading the title of the thread will not be expecting to answer a question about debugging a LISP routine. You should have started a new thread. Maybe a mod will see this and correct the situation.

 

You should have placed this in the AutoLISP forum.

Posted

first things first, localize your variables.

using 1+ and 1- will give much better results when incrementing.

 (setq key (1+ key))

what is this supposed to be selecting?

 (setq ss (ssget "x" (list (cons 2 "NODE"))))

(defun c:nod()

(command "setvar" "osmode" 1)

(setq ss (ssget "x" (list (cons 2 "NODE"))))

(setq len (sslength ss))

(setq key 0)

(repeat len

(setq ssn (ssname ss key))

(setq ins1 (cdr (assoc 10 (entget ssn))))

(command "zoom" "c" ins1 3000)

(command "move" ssn "" ins1 pause)

(setq key (+ 1 key))

 

)

)

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