Lee Mac,
You may also want to think about exporting in an AutoLisp list format
Code:
(setq x 45 y 50 z 55)
(setq wf (open "mydata.dat" "w"))
(write-line "(setq mydata '(" wf)
(foreach v '(x y z)
(princ "(" wf)
(prin1 v wf)
(princ (strcat " . " (rtos (eval v) 2 8) ")") wf)
(write-line "" wf))
(write-line "))" wf)
(close wf)
Then you access it later by using the (load) function
Code:
Command: (load "mydata.dat")
Command: !mydata
((X . 45.0) (Y . 50.0) (Z . 55.0))
(assoc 'x mydata)
(cdr (assoc 'x mydata))
This is very similar to a XML file but in AutoLISPs list format. -David
Bookmarks