Loop thru list from excel

Loop thru list from excel

Anonymous
Not applicable
497 Views
2 Replies
Message 1 of 3

Loop thru list from excel

Anonymous
Not applicable

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.

0 Likes
498 Views
2 Replies
Replies (2)
Message 2 of 3

Libbya
Mentor
Mentor

While your question refers to Dynamic Blocks, it is a LISP question rather than a Dynamic Blocks question.  Because of that, I think that you will likely get better results posting to the LISP forum rather than the Dynamic Blocks forum.  

0 Likes
Message 3 of 3

Anonymous
Not applicable

Fair enough, will repost there. Thanks.

0 Likes