list command (also see IDPOINT>EXCEL)
list command (also see IDPOINT>EXCEL)
(OP)
Further to my earlier thread - The list command lists all the coordinates ofa selected object - GREAT - but it also contains lots of other information which is useless to me. How can I delete this easily without having to resort to putting it in notepad and doing it myself?
Thanks in advance
Thanks in advance





RE: list command (also see IDPOINT>EXCEL)
copy the text below the line of askerisks to a text file and save it as PList.lsp, then use appload to load it into AutoCAD. After the program loads, enter plist at the command line. The program writes the point location out to a comma delimited text file that you can open in Excel.
I hope that this helps
**********************************************************
;;PList.lsp - collect all points in drawing and write them to a comma delimited file
(defun C:PLIST (/ POINT_LIST INDEX PFILE);;define function - declare local variables
(setq POINT_LIST(ssget "x" (list '(0 . "POINT"))));;create selection set of all points
(setq INDEX 0)
(setq PFILE (open "PLIST.TXT" "w"));;create file to write to
(repeat (sslength POINT_LIST);;recurse through the selection set
(setq POINT (cdr(assoc 10(entget(ssname POINT_LIST INDEX)))))
(setq X (car POINT)
y (cadr POINT)
Z (caddr POINT)
)
(write-line (strcat (rtos X)","(rtos Y)","(rtos Z)) PFILE)
(setq INDEX (1+ INDEX))
);;end repeat
(close PFILE);;close PLIST.TXT
);;End of function
(prompt "\nType PLIST to execute")
RE: list command (also see IDPOINT>EXCEL)
I have tried it and I get an error - lselsetp nil
what does this mean?
Thanks
Andrew299
RE: list command (also see IDPOINT>EXCEL)
This means that the routine didn't find any points. What are the entities that you are trying to list?
List one of the objects, then cut and paste in your reply.
RE: list command (also see IDPOINT>EXCEL)
Thanks for the program anyway
Andrew
RE: list command (also see IDPOINT>EXCEL)
All the data in the drawing can be extracted and exported to a text file.
Look at the dxf reference in the autocad help file.