Hello,
I am a mechanical engineer, using autocad for a parabolic profile. I have to take coordinates OF about around hundred points on the profile, I want the system do it for me using autolisp program. I have got the code for getting the points coordinates using getpoint, but know to store that points in a text format has become a problem, so please help me in completing my code
Hope this helps.
(defun c:mypoints()
(setq ents(ssget"x"(list(cons 8 "mylayer")))); looks for everything on layer mylayer
(setq mfile(open "c:/pickpoints.txt" "w")); write a txt file in c:
(setq cnt(sslength ents))
(setq c 0)
(repeat cnt
(setq elist(entget(ssname ents c)))
(setq a(cdr(assoc 10 elist))); starting point of a line not (assoc 11 elist) is ending point
(setq x(car a))
(setq y (cadr a))
(setq ans(strcat "X" (rtos x 2 4)"Y" (rtos y 2 4))); 4 place decimal
(print ans mfile)
(setq c(+ c 1))
)
(close mfile)
)