PDA

View Full Version : Area program & Reactors



cadconcepts
2005-02-02, 03:19 PM
Hi Everyone-

A while back, I wrote a program that allowed the user to draw a closed Polyline and once done the program would read the area and applied it to an inserted attribute block. At this point, I am trying to figure out how to update the program so that if someone modifies the boundary it will automatically update the tag. I have looked at several programs that do this with reactors but they either use a field tag or a piece of text. In my case, I would like it to affect an attribute tag. If anyone has some code that they are willing to share or to give me some direction I would greatly appreciate it. Thanks in advance.

Manuel A. Ayala
CAD Concepts

Tom Beauford
2005-02-02, 07:06 PM
You can insert a field into an attribute as well. Take a look at CADALYST 10/04 Tip1985: TARB.LSP (http://new.cadalyst.com/code/browseyear.cfm?fullyear=2004#10) Link Area Text to Boundary (c) 2004 Leonid Nemirovsky. I'd love to see it when you're done, there's a lot of advantages to using an attribute.

peter
2005-02-03, 01:03 PM
There are a couple of way to do this. One is to use object reactors. The problem with this is everytime you open a drawing you would need to search out and restore all of the reactors to all of the polylines. This might be cumbersome in a big drawing.


Another way is to use a acdbreactor and on the modify event check to see if the object modified is one of your polylines. If it is have it check the next entities until it finds the tag block and then modify the attribute with the new are value.

Both methods should be able to do it, without using the fields although that is another way to do it that might prove easier.

Peter Jamtgaard