Exporting lines to Excel??

Discussion in 'AutoCAD' started by Bill Allen, Apr 26, 2004.

  1. Bill Allen

    Bill Allen Guest

    I apologize if this crosspost is annoying.

    I would like to do the following:

    I have some simple line work (all straight line segments, not attached to
    each other), all on the same layer I would like to export the end points to
    an Excel spreadsheet. I would also like to bring along with it an
    "identifier" (ID?) so that I can keep track of each line.

    I don't know how to:
    Attach an "ID" to a line (attribute?)
    export to Excel.

    Question:
    If this is possible, where should I start reading in my AutoCAD books?
    Caution: I have linework on other layers I don't want exported, but I will
    create a special distinctive layer name for this linework and these lines
    will be the only entities on this layer.

    TIA,

    Bill
     
    Bill Allen, Apr 26, 2004
    #1
  2. Bill Allen

    Jeff Mishler Guest

    Hi Bill,
    For the "ID", just use the handle that Autocad assigns each entity already.

    For collecting just the lines on Layer "SpecialLines" you can use something
    like this:
    (setq sslines (ssget "x" '((0 . "LINE")(8 . "SpecialLines"))))
    Look up ssget in the help for what this means & how it works......

    Cycle through the selection set you create with the above code and extract
    each line's startpoint, endpoint & handle to a list.

    Search this newsgroup, the help file and the Sample folder of the ACAD
    installation for help with linking/reading/writing to Excel. There is an
    abundance of info in those 3 places to get you well on your way.
    (Hint, look for postings by Marc'Antonio Alessi with MsxUtl01.lsp
    listed....these are great utilities for working with Excel.)

    Good luck and don't hesitate to ask for help if you get stuck, a number of
    us on here are more than willing to help out up & coming lispers.

    Jeff
     
    Jeff Mishler, Apr 26, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.