Results 1 to 3 of 3

Thread: Change block layer through excel lookup

  1. #1
    Member
    Join Date
    2010-10
    Posts
    21
    Login to Give a bone
    0

    Default Change block layer through excel lookup

    Dear Clever People!

    We have an excel table with two columns: Name & Value
    We are looking for a way to have a block lookup the table, check for the row with its own name find the value.
    Then using the value either change the blocks layer or change the objects hatch colour accordingly.

    Eg
    1=red, 2=green, 3=blue,

    Possible Steps.
    1. On lisp run from cmd or button.
    2. Search for all blocks in current drg.
    3. Use block name. (Or other attribute value if eaisier)
    4. Lookup excel file sheet 1.
    5. Find block name in column A.
    6. Return value from same row in column B.
    7. Use value from column B to either move the block to a layer by the value or edit the colour of blocks hatch to the column B value.

    I have looked at a lot of forums in search for this but can't see anything that would work..anyone any ideas?

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

    Default Re: Change block layer through excel lookup

    Are you searching on the overall idea? Have you tried searching on the steps you've outlined?

  3. #3
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: Change block layer through excel lookup

    Poor mans answer is to do a csv dump of the excel, and just read that file. In excel create a macro for the csv bit so it writes 1 file only.

    2nd better answer google excel <-> Autocad lots of example code.

Similar Threads

  1. Change CAD layer through Excel VBA or LISP
    By bagusdewantoro86762677 in forum VBA/COM Interop
    Replies: 5
    Last Post: 2019-02-14, 10:41 PM
  2. Replies: 8
    Last Post: 2015-05-18, 12:18 AM
  3. Replies: 5
    Last Post: 2008-11-27, 06:38 AM
  4. Replies: 6
    Last Post: 2007-05-30, 05:45 PM
  5. Replies: 7
    Last Post: 2006-10-23, 04:18 AM

Posting Permissions

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