Jump to content

AutoLISP for coordinate extraction


Recommended Posts

Posted

Hi can anyone explain the following LISP coding pls...

It would be very helpful...

 

;;;Select points and export their co-ords to excel file

;;;=========================================

(defun C:EPEX(/ ss fn f e p)

(prompt "\nSelect points to export:")

(if not (setq ss (ssget '((0 . "POINT"))))

(progn (alert "No objects selected!") (quit))

)

(if (not (setq fn (getfiled "Export to file" (getvar "dwgprefix") "csv" 1)))

(progn (alert "No file selected!") (quit))

)

(setq f (open fn "w"))

(while (setq e (ssname ss 0))

(setq p (cdr (assoc 10 (entget e))))

(princ (strcat (rtos (car p)) "," (rtos (cadr p))"\n") f)

(ssdel e ss)

)

(close f)

(alert (strcat "Finish export points to file: " fn))

)

;;;=========================================

Posted

Now a little experiment with two objectives:

 

1. determine how quickly Google indexes this site;

2. determine how quickly the professor to determine the source of students code.

 

The result speaks for itself :D:D:D

 

Of course the student has a chance if well be working on it.

test2.jpg

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