PDA

View Full Version : Global values?



BUrBaKy
10th May 2011, 07:08 am
Hi all!
Here's my problem:
I have a open drawing in witch i'm currently working. From time to time during the work i need to insert a block with attributes. I'm inserting it with values chosen through a Form from an excel file.

The problem is that it's taking too long to open the excel file each time i want to insert a block. My macro opens the file, gets some values to my form (in comboboxes), i push a button and it insert's the block. Then the macro ends. Then i continue drawing and after that i need to insert again and the procedure repeats its self.

Instead I want to open the excel file just one time at the beginning of my work and load the information needed in some sort of global array or something that i can use multiple times during the session.

Is that possible?

BIGAL
10th May 2011, 07:54 am
You need to open excel once and just save the variables, 2nd or 3rd etc time check if say a variable exists and not do the excell bit. make the excell part a defun within program easier to code then.

(if (<> variable1 nil)
(princ "excell done")
(runexcell))