Loop thru list from excel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have pieced together some code from a couple of places and am not sure how to go about the next portion. The current code will take the name of dynamic blocks and change the blocks to a hard coded visibility state. I have this lisp being called from another lisp and then ran on multiple drawings.
Now, I want to read a list of values from excel where there dynamic block name will have a visibility state associated with it. Each block name in the excel file will be a variable in the lisp and the state will need to read from the excel file from the matching block name and saved as the value of the block name variable. I don't know how to begin this part.
I've attached this lisp. If I had to start somewhere on it, I would think writing a new defun called readvis would call the defun changevis. The readvis function would take a variable from a calling lisp for the excel file name and sheet name, then it would open the excel file, find the sheet, then read the data in as a list. This list would then be looped thru and compare the blocknames in the change vis state to the 1st column of the list. If a matching block name is found, the value of that block name varialbe will be set to the 2nd column of the list.
Thanks in advance and let me know if you need more info.