×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Anyway to extract coordinates into excel file?

Anyway to extract coordinates into excel file?

Anyway to extract coordinates into excel file?

(OP)
   I have some test locations that are plotted in AutoCAD 2002.  I need to extract the coordinated into an excel file so that they can be imported into a program that will plot them using a profile wiew.  I'm not sure what program the engineer is using, but I know he won't use AutoCAD.  Is there anyway that I can select the points (About 40 of them), and extract the coordinates?  

RE: Anyway to extract coordinates into excel file?

you can use the list command and select
or window the profile.  Then cut and paste
to a text file or whatever.

RE: Anyway to extract coordinates into excel file?

I can do that for you if you can get me your drawing.  They don't like us putting email addresses on this site.  So that option is out.  You might post your question at www.theswamp.org  They can probably help you out as well.

Scott

RE: Anyway to extract coordinates into excel file?

(defun c:CoordinatesOut(/ nnn k14 p1 p2 p3 p4 p5 nno zz)

        (setvar "cmdecho" 0)
(if (= olcek nil)
(load "olcek")
)
        
        (command "ddosnap")
        (setq
        k14 (getvar "osmode"))
        (
        princ
        "Name of an ascii file <")
        (

        princ z)
        (

        princ ">:")
        (setq zz (getstring))
       (if (= zz "")
        (terpri)
        (setq z zz))
      (setq isim (open z "a"))
      (princ z)
      (terpri)
      (princ "Initial number of point ID <")
      (princ no)
      (princ ">:")
      (setq nno (getint))
      (if (= nno nil)
      (terpri)
      (setq no nno)
      )
      (setq no (- no 1))
(while
    (/= nnn 1000)
        (setq no (+ no 1))
        (terpri)
        (princ no)
        (princ ".")
        (setq a (getpoint "Point:"))
(if (/= a nil)
(progn
        
        (setq yuksek (* olcek 2))
        (command "text" a yuksek 100 no)
        
        (setq p1 (car a))
        (setq p2 (cadr a))
        (setq p3 (caddr a))
        (print no isim)
        (princ (rtos p1 2 3) isim)
                (princ (chr 32) isim)
        (princ
        (rtos p2 2 3) isim)
                (princ (chr 32) isim)
        (princ
        (rtos p3 2 3) isim)
    
    )
    (setq nnn 1000)
))
(command "redraw")
(setvar
"osmode" k14)
(close isim)
(princ)
)  

Try the above lisp.  You have to select the points individually, but it will pull out your coordinates to a txt file.  Make sure you list the directory when it asks for a file name example:  c:/acaddwg.txt  You should be able to open your text file in excel.  I didn't write this, and I don't know where it came from.  Maybe someone can modify it do you don't have to select the points individually.  I'm not smart enough to figure that out.  Let me know if you need help.

Scott

RE: Anyway to extract coordinates into excel file?

(OP)
I'm sorry for asking a newbie question.  Where do I paste this program and how do I run it.  Am I supposed to paste this code into a text file and then open it up in autocad?  Please help.  Thanks?

Joe Stiles

RE: Anyway to extract coordinates into excel file?

Copy the code into a text editor
Save it in your autocad support path as CoordinatesOut.lsp (don't forget the .lsp)
Open autocad
Click Tools - Load Application
Navigate to the CoordinatesOut.lsp file and double click it.  To run the application type coordinatesout in the command line.  The application will ask a question in some foreign language.  Basically it is asking you for a map scale.  I just press enter and except the default (100).  You will then be asked to name the output file.  Make sure you give the path as well as the file name:  example: c:/autocaddrawing.txt

Don't forget the .txt.  Select your points one by one.  The application will number the points as you select them.  Press enter after you select all the points.  You should have a text file named autocaddrawing.txt saved on your c: drive after you press enter.  You can then open this in excel.

If you have any questions feel free to ask.

Scott

RE: Anyway to extract coordinates into excel file?

(OP)
Thanks Scott.  I got an olcek error, but at least I know how to run these lisp programs.  I had no idea autoCad was capable of doing this.  How many years have you worked with cad.  I ask because I have been working since highschool (4yrs), and now I feel like there are many things that I need to learn. What are your suggestions for me taking my drafting to the next level.  ie. school, trade school,  ITT Tech, etc.??

RE: Anyway to extract coordinates into excel file?

About learning CAD:

Furthermore you assit to a school or course , the web is full of info, please register at the
http://www.theswamp.org/ and put the same topic
There is a good topic about what you need it allow to extract directly data to a excell sheet.

www.cadtutorforum.net

RE: Anyway to extract coordinates into excel file?

Just realized there is another file required to run that lisp.  Follow this link and download the full application.  There might be other things there you can use.  
http://arcscripts.esri.com/details.asp?dbid=12779

As for taking your drafting to the next level, I have no idea.  I've been using autocad for about 4 years and learned a lot from the website hyposmurf mentioned.  I highly recommend you register at that site.  It's free too.  And the people that inhabit the site are very knowledgable with autocad, lisp and just about everything else that deals with cad.

scott

RE: Anyway to extract coordinates into excel file?

(OP)
Thanx for all the info guys.  

RE: Anyway to extract coordinates into excel file?

You can get a lot of good training on cad at your local Junior college. This is generally much cheaper and the info is usually as good. Also ask your local CAD Vendors they usually hold specialized classes. And lastly watch Autodesk website for seminars coming to your town.

RE: Anyway to extract coordinates into excel file?

I got another question pertaining to this post.....

I used the Lisp function that you provided...It worked great.  However I wish to append it so that I can label the distance between point 1 and point 2, line1. Label distane between point 2 and 3, line 2...so on and so on...

Is there a quick way of doing this other than running it in VB?

thanks,
Harsimran Braich

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources