Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
;|
write_to_file.LSP
A routine to write picked points to an external file
|;
(defun C:w2f ()
(graphscr)
(setq FNM (getstring "Enter name of text file to create: "))
(setq FNM (strcat FNM ".txt"))
(setq FD (open FNM "w"))
(setq HEAD "POINT \t\tX \t\tY \t\tZ")
(write-line "Exported coordinates:-" FD)
(princ "\n" FD)
(write-line HEAD FD)
(princ "\n" FD)
(initget 1)
(setq N1 (getint "\nEnter number of points to export: "))
(if (Null PN)
(setq PN 1)
)
(prompt "\nEnter first point reference number <")
(princ PN)
(setq PNN (getint ">: "))
(if (Null PNN)
(setq PN PN)
(setq PN PNN)
)
(repeat N1
(initget 3)
(setq P1 (getpoint "\nPick point to export: "))
(setq PX1 (car P1))
(setq PX1 (rtos PX1 2 3))
(setq PY1 (cadr P1))
(setq PY1 (rtos PY1 2 3))
(setq PZ1 (caddr P1))
(setq PZ1 (rtos PZ1 2 3))
(princ PN FD)
(princ "\t\t" FD)
(princ PX1 FD)
(princ "\t" FD)
(princ "\t" FD)
(princ PY1 FD)
(princ "\t" FD)
(princ "\t" FD)
(princ PZ1 FD)
(princ "\n" FD)
(setq PN (1+ PN))
)
(close FD)
(setq PN nil)
(princ)
)(prompt "To use, enter w2f at the command line.")
(princ)