If the data in the dat file is a comma delimited text file this function will import it as a list of sublists, that can be manipulated to drawing objects.
(csvfiletolist "c:/acad/mydatafile.data" ",")
Peter
; Import a CSV File to a list of Sublists
(defun csvFiletoList (strFilename strChar / lstOfSublists strText z)
(setq z (open strFilename "r"))
(while (setq strText (read-line z))
(setq lstOfSublists (cons (CSVStringToList strText strChar) lstOfSublists))
)
(close z)
(reverse lstOfSublists)
)
; Parsing a textstring to a list.
(defun CSVStringToList (strText strChar / intPosition lstStrings)
(while (setq intPosition (vl-string-search strChar strText 0))
(setq lstStrings (cons (substr strText 1 intPosition) lstStrings)
strText (substr strText (+ intPosition 1 (strlen strChar)))
)
)
(reverse (cons strText lstStrings))
)