Results 1 to 8 of 8

Thread: Create lisp to extract data from excel file

  1. #1
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Create lisp to extract data from excel file

    I don't really understand a whole lot about autocad interfacing with excel. I have done a search on excel in the lisp forums and found a few things, but don't understand the code.I have code written for a program that uses a dialogue box. The user will pick or enter the necessary data. I am looking to connect to an excel spreadsheet that has multiple workbooks. Depending on what data that is selected in the dialogue box depicts which worksheet that should be selected and what data should be taken off that work sheet. In the end i will use the data from the excel sheet to draw an object with the dimensional data from the excel worksheet.

    I am sure this is possible from some code i have found through my search, but i don't know what commands to use to select the range of data i would like returned, how to open the correct worksheet, and how to do all this behind the scenes either as the user is selecting the necessary input data from the diaogue or after the user has selected ok.

  2. #2
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    I would really, REALLY, recommend using VBA to interact with Excel. Otherwise, prepare for less hair.
    If you are going to fly by the seat of your pants, expect friction burns.
    Some say beauty is in the eye of the Beholder... perhaps so, but I've only seen the disintegration beam.
    Everyone else being wrong is not the same thing as being right.

  3. #3
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    The only problem is i don' tknow any VBA. Would always love to learn a new language, but don't have a whole lot of spare time to spend on learning a new language. I also got that feeling from some other posts i ahve read taht VBA is best suited for this interaction.

  4. #4
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    You could use something like ADOLISP. It's a free addon to connect to any data source through something like ODBC (Window's Open Data Base Connectivity). I know it works for Excel, CSV, DBase, Access, MySQL, and any other data storage / retrieval program with an ODBC driver. You can find the website here http://acad.fleming-group.com/index.html.

    However, it's not going to be as easy as with VBA, dgorsman is right about that.In Excel, you'll have to create ranges for ODBC to work with it as if it's a database with tables. Otherwise, I'd suggest saving your XLS file to a DBase file for each tab, then using the DBase connection - which can be read / write inside AutoCAD / AutoLisp, unlike Excel which can only be read.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  5. #5
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    yea that seems very difficult to figure out. I guess I will end up learning VBA which in the long run will help me out.

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,463
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    Quote Originally Posted by Lions60 View Post
    yea that seems very difficult to figure out. I guess I will end up learning VBA which in the long run will help me out.
    Does this post offer any help?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    Thank you that helps a lot.

  8. #8
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Create lisp to extract data from excel file

    Quote Originally Posted by Opie View Post
    Does this post offer any help?
    Shot thanks, this works much easier than fiddling with ODBC!
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. Replies: 39
    Last Post: 2018-01-11, 02:07 PM
  2. Extract Title Block Attribute Data to Excel
    By bzrqmy in forum AutoCAD Customization
    Replies: 7
    Last Post: 2017-04-26, 06:26 AM
  3. Replies: 4
    Last Post: 2015-08-29, 04:40 AM
  4. Please, help me extract data Dynamic Blocks and Attribute blocks to Excel
    By minhphuong.humg453254 in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2014-04-17, 08:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •