CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 7425
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedSimple Lisp Problem?

 Post Reply Post Reply
Author
jpkibble View Drop Down
Newbie
Newbie


Joined: 19.Nov.2010
Location: United Kingdom
Using: AutoCAD 2006
Status: Offline
Points: 6
Direct Link To This Post Topic: Simple Lisp Problem?
    Posted: 29.Nov.2010 at 16:58
Hi,

The lisp below works great for extracting a list of comma separated values from a csv file. In this case two columns with x coordinates in one and y coords in another.

However when I try and use car and cadr to extract the first column value from the second CAD returns an error.

I'm sure this one's about the data type not being a list.

Can anyone help?




(defun c:csv ()

(setq selfile (getfiled "Select File" "" "csv" 0))

(setq openfile (open selfile "r"))

(while (setq line (read-line openfile))

(defun c:csv ()

(setq selfile (getfiled "Select File" "" "csv" 0))

(setq openfile (open selfile "r"))

(while (setq line (read-line openfile))

(setq linex (car line))
(setq liney (cadr line))

(princ "\n")
(princ line)
(princ "\n")
(princ linex)
(princ "\n")
(princ liney)

)



)

Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,383 seconds.