PDA

View Full Version : MDE and lisp



Coolmo
2004-06-23, 01:51 PM
Is there a way to access how many drawings are open in the Multiple Design Environment with a lisp routine or is there a system variable or environment variable that changes when a new drawing is called up in MDE and then can I access or query that?

Ed Jobe
2004-06-23, 02:53 PM
Lisp has some limitations when it comes to "working" with multiple dwgs, since the lisp namespace is active only in the current dwg. The only part that bridges dwgs is the blackboard. But, using the ActiveX api, you can certainly find out about other dwgs. Have a look at the AcadApplication.Documents collection. The Count prop will tell you how many are open, and you can use For Each to iterate the collection and examine ead doc's Name prop.

Coolmo
2004-06-23, 03:15 PM
The only thing I need to know is just how many are open in the MDE. I'd like for a small proggy to load with the acaddoc.lsp (which I assume will reload everytime a new drawing is opened up in the MDE) that will check the number of drawings open and give an "alert" when more than 2 are open. I need to write and load this in lisp so I can simply add it to the acaddoc.lsp file and have it work companywide. Ideas?

Ed Jobe
2004-06-23, 03:37 PM
That's no problem. When I said "have a look", I was referring to the ActiveX developer's guide. It has examples too. However, I might question your program's logic. First, poping an alert in that case may get annoying. If you are trying to prevent them from oping more than one dwg, just set sdi=1, or create a reactor that watches for that sysvar to change and reset it.

Coolmo
2004-06-23, 03:45 PM
Even though LDD doesn't allow for multiple drawings to be open, it's still a good tool if you use it with consideration for others that might need to get into the files. The problem we're having is too many people get into 7-10 files at a time because they don't release them whenever they make the slightest change. I was trying to get a box to come up to suggest closing some of the ones they weren't using at the time. Merely a reminder that gets them in the habit of closing files after they're done with them. I'll check out the ActiveX stuff you suggested though.