TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Shade on May 11, 2006, 01:53:14 PM

Title: Auto Block Counter Reactor
Post by: Shade on May 11, 2006, 01:53:14 PM
I am looking to write an AutoBlock counter using reactors, but I don't quite have the concept yet.
So I was wondering how other people would approach this topic?

My pseudo code:

Code: [Select]
1. Select block to count
2. Find all occurrences of block in drawing
3. Insert text showing the count
4. Attach handle of text to reactor for block name
5. Expand insert command to include a callback that checks blockname, If its the block name specified in reactor add to count.
6. Store reactor in drawing to eliminate need to load reactor manually while in drawing

That is what I have so far.
I am having problems with the concept of the reactor checking the block name, and having the reactor react automatically, so that i don't have to load the reactor manually.

I am using the following example as a guide somewhat…
http://www.theswamp.org/index.php?topic=7308.0

Is the pseudo possible?

Any help would be appreciated....  :mrgreen:
Title: Re: Auto Block Counter Reactor
Post by: Crank on May 13, 2006, 02:35:29 AM
[...]
So I was wondering how other people would approach this topic?
[...]
It depends on your skills and time you want to spend, but you can make a big project of this.
To keep thinks simple I shouldn't bother for the visibility states of dynamic blocks. That can be done in your next release ;) .

This is how I should do this:This code (http://www.theswamp.org/index.php?topic=9441.msg122823#msg122823) of Luis might be a good start/example.
Title: Re: Auto Block Counter Reactor
Post by: ronjonp on May 13, 2006, 10:11:56 AM
Or you could wait for the next release of AutoCAD as this functionality is already part of 2006.
Title: Re: Auto Block Counter Reactor
Post by: Joe Burke on May 13, 2006, 12:55:49 PM
Also keep in mind nested blocks. For instance, ET BCOUNT does not count them.