updated the lisp with the following
- entmake for point and text (faster)
- got rid of nth its slower then then car cadr caddr last
- updated while to combined lines of code
Also I don't think the easting and northing are in the right order but left it like the lisp had it. so if your points are in the wrong spot maybe update to below
(setq POINT
(list
(cadr POINT_LINE) ;Get x
(caddr POINT_LINE) ;Get y
(last POINT_LINE) ;Get z
)
)
; POINTPLT is a simple AutoLSIP program that will plot a coordinate points file
; in AutoCAD. To run POINTPLT, load POINTPLT.LSP as you would any normal
; AutoLISP file (see AutoCAD Reference Manual), type "POINTPLT" and press
; [Enter]. POINTPLT will first prompt you for an input coordinate filename.
; You must enter a vaild DOS filename at this point. The input coordinate file
; must be in the following format:
;
; POINT NO. NORTHING(y) EASTING(x) ELEVATION(z)
;
; A sample input coordinate file (SAMPLE.DAT) is included with POINTPLT.
;
; POINTPLT uses the default (current) text style and layer. However, the
; current text style must have a defined height (height must not be "0").
;
; If you have any questions or comments concerning POINTS, I may be reached
; via THE SPECTRUM BBS þ (501) 521-5639
;
;-------------------------------------------------------------------------------
; * ERROR Trapping *
;
(defun *ERROR* ()
(eop)
)
;-------------------------------------------------------------------------------
; * End of program *
;
(defun EOP ()
(setvar "CMDECHO" POINTSPLT_CE)
(princ)
)
;-------------------------------------------------------------------------------
; * Main Program *
(defun C:POINTPLT (/ IN_FILE POINT_LINE POINT_NO POINT)
(setq POINTSPLT_CE (getvar "CMDECHO"))
(setvar "CMDECHO" 0) ;Turn "Command Echo" off
(prompt "\n\nP O I N T P L T v1.0 -- Copyright (c) 1992 by Kurtis J. Jones / -Mate Software\n\n")
(setq IN_FILE (open (getfiled "\nEnter points filename: " (getvar 'DWGPREFIX) "txt" 16) "r"))
(while (setq POINT_LINE (read (strcat "(" (read-line IN_FILE) ")"))) ;Read POINT_LINE from input file
(setq POINT_NO (car POINT_LINE)) ;Get the point number
(prompt (strcat "\nPlotting point no. " (itoa POINT_NO)))
(setq POINT
(list
(caddr POINT_LINE) ;Get easting
(cadr POINT_LINE) ;Get northing
(last POINT_LINE) ;Get elevation
)
)
(entmake (list '(0 . "POINT") (cons 10 POINT)))
(entmake (list '(0 . "TEXT") (cons 10 POINT) '(40 . 1) (cons 1 (itoa POINT_NO))))
)
(close IN_FILE)
(prompt "\nPOINTPLT finished")
(prompt "\n ")
(eop)
)