Attribute to Excel

Discussion in 'AutoCAD' started by jclaidler, Dec 18, 2003.

  1. jclaidler

    jclaidler Guest

    With autolisp, is there a way to extract a certain attribute and place it in an Excel spreadsheet. Also, is there a way to determine which field in Excel the value can be placed??

    Thanks for any help.
     
    jclaidler, Dec 18, 2003
    #1
  2. jclaidler

    rewilson Guest

    Yes, by using the tag strings in the attributes. I'm not really
    good with macros, but ours looks like this:

    Assembly:
    'RowNum = 2
    For Each elem In mspace
    With elem
    If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
    If .HasAttributes Then
    Array1 = .GetAttributes
    RowNum = RowNum + 1
    For Count = LBound(Array1) To UBound(Array1)
    'excelSheet.Cells(RowNum, Count + 1).Value = Array1(Count).textstring
    ' The following lines will save the value of each arrays textstring and _
    write it to the selected row and column. To put this macro back to the way _
    it was originally, just comment the following lines and un-comment _
    the above single line.(k.a. 1-15-98)
    mknum = Array1(0).TextString
    tagstring = Array1(Count).tagstring
    If tagstring = "PART/DWG" Or tagstring = "DWG#" Then 'Found the Title Block
    RowNum = RowNum - 1
    GoTo 15
    End If
    If tagstring = "TAG" Then ' found a Machine Mark Block
    RowNum = RowNum - 1
    GoTo 15

    Our Excel sht headers match the tags in the attributes of the bill of materials. I can send you the entire excel file with the macro if you'd like. Just let me have your e-mail. Maybe you
    can look at it and tell more. HTH :)
     
    rewilson, Dec 18, 2003
    #2
  3. http://tinyurl.com/2ba9w

    searched for excel and came up with 112 topics



    http://tinyurl.com/2gprq

    searched for excel and came up with almost 1000 topics


    Surely one of them will help you.



    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    spreadsheet. Also, is there a way to determine which field in Excel the value can be
    placed??
     
    Jason Piercey, Dec 18, 2003
    #3
  4. jclaidler

    kozmos Guest

    In fact, doing this need ActiveX, so former AutoLISP can not do it. but Visual LISP can do.
    you may go to www.ikzomos.com to download OAsis-XLS and try the API. A very simple way in data exchange between Visual LISP & Excel
     
    kozmos, Dec 19, 2003
    #4
  5. jclaidler

    jclaidler Guest

    jclaidler, Dec 19, 2003
    #5
  6. jclaidler

    Brockster Guest

    I did a little digging around and found the correct spelling: www.ikozmos.com.
     
    Brockster, Dec 19, 2003
    #6
  7. jclaidler

    kozmos Guest

    kozmos, Dec 20, 2003
    #7
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.