PDA

View Full Version : read out coordinates X,Y


ros
2006-07-03, 12:41 PM
Hello all,
I am looking for a lisp routine that read out the coordinates in a X,Y table.
(ascii or excel)
The job I have to do is:
I have a lot of old drawings with information drawed in the earlier days with the pen.
The drawings comes in tif-format (scan from the original drawing)
Now the information on the analog maps have to become digital.
In the attachment (analog.jpg) you see a map with the drawed points.
I now want to click with my mouse in succession on the drawed points, and than I hope
there is something (in lips) witch generate a point file.
Something like this
filename: coordinates map 21 (ascii or excel)
X | Y and possibly a supplementary text (order number from my company)
109200,448900,25858
Thanks for help, in advance thanks, Theo

rkmcswain
2006-07-03, 03:12 PM
Digitize your map as AutoCAD POINT entities, then you can use something like this to write your CSV file.


(setq fn "C:\\temp.csv" i -1)
(setq ss (ssget "_X" '((0 . "POINT"))))
(setq fp (open fn "w"))
(while (setq obj (ssname ss (setq i (1+ i))))
(setq crd (cdr (assoc 10 (entget obj))))
(princ (strcat
(rtos (cadr crd) 2)
(chr 44)
(rtos (car crd) 2)
(chr 44)
(rtos (last crd) 2) "\n"
)
fp)
)
(close fp)
(startapp "notepad" fn)

kennet.sjoberg
2006-07-03, 11:20 PM
. . .there is something (in lips) witch generate a point file. . .
Hi Theo,
If you have the tif loaded in the dwg, I suppose you will be pleased with only manually digitized X and Y and a supplementary text.
If you want to convert all in to vectors, it is an other task.
This is my attempt to help you.

(defun C:PickPoints (/ MyFile File#1 Continue PickApoint AddText Ans )
(setq MyFile "C:\\temp.txt" )
(setq File#1 (open MyFile "w" ) )
(setq Continue T )
(while Continue
(setq PickApoint (getpoint "Pick a location : " ) )
(if PickApoint (setq AddText (getstring T "Add text : " )) ( ) )
(if PickApoint
(if AddText
(princ (strcat (rtos (car PickApoint )) "," (rtos (cadr PickApoint )) " " AddText "\n" ) File#1 )
(princ (strcat (rtos (car PickApoint )) "," (rtos (cadr PickApoint )) "\n" ) File#1 )
)
(progn
(initget 1 "Yes No")
(setq Ans (getkword "Close file ? (Yes or No) "))
(if (= Ans "Yes" )
(progn
(close File#1 )
(setq Continue nil )
)
(setq Continue T )
)
)
)
(setq PickApoint nil AddText nil )
)
(startapp "notepad" MyFile )
(princ)
)

: ) Happy Computing !

kennet

ros
2006-07-04, 10:09 AM
Kennet, Thanks for the lisp "pickpoints" its very usable to for digitalizes the data from my old drawing.
It helps me a lot.
regards Theo

Doodlemusmaximus
2006-07-04, 10:33 AM
Great little lsp lads it'll come in really handy with the setting out points for future jobs


Cheers

kennet.sjoberg
2006-07-05, 12:46 AM
Kennet, Thanks for the lisp "pickpoints" its very usable to for digitalizes the data from my old drawing.
It helps me a lot.
regards Theo
I am glad to help. . .

: ) Happy Computing !

kennet