Jump to content
Sooshiant

Need a lisp to LIST all selected point coordinate at once

Recommended Posts

Sooshiant

When you select some points and type list, AutoCad brings a list of some data such as point coordinate and layer name or color etc. On the other hand if you have a large number of points you need to press enter and go to next page.

 

One year ago I saw a lisp routine which could list all point coordinates in list window without any further unnecessary data, so you could copy and paste all your selected point coordinates to a text file or excel at once.

 

Now I have lost that great lisp. That was something like this pic (this has created by Photoshop)

 

01.jpg

 

If anyone have it please give it to me or please write a lisp like this for me again. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Lee Mac
(defun c:lixt ( / i s )
   (if (setq s (ssget '((0 . "POINT"))))
       (repeat (setq i (sslength s))
           (princ
               (apply 'strcat
                   (mapcar 'strcat '("\n\tX=\t" "\tY=\t")
                       (mapcar 'rtos (cdr (assoc 10 (entget (ssname s (setq i (1- i)))))))
                   )
               )
           )
       )
   )
   (princ)
)

Share this post


Link to post
Share on other sites
Grrr
(defun c:lixt ( / i s )
   (if (setq s (ssget '((0 . "POINT"))))
       (repeat (setq i (sslength s))
           (princ
               (apply 'strcat
                   (mapcar 'strcat '("\n\tX=\t" "\tY=\t")
                       (mapcar 'rtos (cdr (assoc 10 (entget (ssname s (setq i (1- i)))))))
                   )
               )
           )
       )
   )
   (princ)
)

 

I bet it took you less time, than OP had to write its request.

Share this post


Link to post
Share on other sites
Sooshiant

You are a genius I love you :)

Share this post


Link to post
Share on other sites
Lee Mac

Cheers guys :)

Share this post


Link to post
Share on other sites
Grrr

I've just played with it a little.. and an idea hit me:

By changing the pdmode variable, the viewport regens automatically, so heres some weird test condition to determine if a regen was successful:

_1$ (setvar 'pdmode (getvar 'pdmode)); can be used instead of regen, which is funny
35

_1$ (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acActiveViewport)
nil

_$ (= (getvar 'pdmode) (setvar 'pdmode (getvar 'pdmode)))
T

_$ (if (= (getvar 'pdmode) (setvar 'pdmode (getvar 'pdmode))) 
(print "Yes") 
(print "No")
)

"Yes" "Yes"
_$ 

I have absolutely no idea where this would be practical, just wanted this info to stay in the archives.

Share this post


Link to post
Share on other sites
Roy_043

Note that the _LIST command will translate geometrical data to the current UCS.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×