Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic area Calculation

56 views
Skip to first unread message

intel

unread,
Jan 20, 2003, 9:15:17 AM1/20/03
to
Hi there,
I am looking for a LISP ot some kind of tool which by usind a Pline on a
closed area it will show me Its area size and if I am changing the Pline
size the area will be accommodate accordingly,

Any ideas
Thank's


Detailing_Dude

unread,
Jan 20, 2003, 9:49:55 AM1/20/03
to
i would like that as well.


--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"intel" <Yossix....@intel.com> wrote in message
news:b0h09n$93p$1...@news01.intel.com...

jojo

unread,
Jan 20, 2003, 10:08:47 AM1/20/03
to
me too!

Question, If you can't do this, can you hatch an area (put it on a non
printing layer)
and then have it update an editable block (for square footage for
instance)??

jo


"intel" <Yossix....@intel.com> wrote in message
news:b0h09n$93p$1...@news01.intel.com...

bestafor

unread,
Jan 20, 2003, 11:39:49 AM1/20/03
to
"area" and then "O" for Object, pick and WOW!!!!!

"intel" <Yossix....@intel.com> wrote in message
news:b0h09n$93p$1...@news01.intel.com...

Detailing_Dude

unread,
Jan 20, 2003, 11:51:44 AM1/20/03
to
No, you didn't understand the request, mr. sarcastic. What we would like is
it to update as we reshape (realtime).

--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"bestafor" <best...@hotmail.com> wrote in message
news:pDVW9.756944$WL3.750593@rwcrnsc54...

P.C.

unread,
Jan 20, 2003, 12:14:31 PM1/20/03
to
Hi

"Detailing_Dude" <ce...@parsinsdetailing.hrcoxmail.com> skrev i en meddelelse
news:AOVW9.9940$8N.12...@news1.east.cox.net...


> No, you didn't understand the request, mr. sarcastic. What we would like is
> it to update as we reshape (realtime).

Eh, -------- case you defined point one as intersection of line 1 and line 4 ,
point one will in Lisp be somthing like inters assoc 10 and assoc 10 of entnext
this. That way you will be able to update the points but only when you trigger a
function that collect the 4 plines from their handles . Guess the reactor or
demons would update the arear calculations done by feeding the Arear function
with the points can be handled this way, but you proberly better ask somone with
better knowleage about these feature than I, still maby it is just as easy to
trigger a function instead of expecting the arear calculations to be updated all
the time.
Case you want the arear within wider polylines ,you need a bit trig. to subtract
the arear of halve the polylines but this shuld be quite simple to.
P.C.
http://groups.yahoo.com/search?query=3d-honeycomb


Jim Patrick

unread,
Jan 20, 2003, 1:04:24 PM1/20/03
to
In alt.cad.autocad, Detailing_Dude wrote:

>No, you didn't understand the request, mr. sarcastic. What we would like is
>it to update as we reshape (realtime).

So get software that does parametrics. Catia, Solidworks, Inventor,
etc can do this with a little extra VBA code.

It's also certainly possible to make a program (and get the executable
to run with AutoCAD as an ARX) that would do what you want. But
AutoCAD isn't --and won't be in the foreseeable future-- parametric.

So it sure isn't going to be a script or lisp (original request) that
don't have "realtime" functions like you ask. Nor do I expect it's be
in the correct price range. <G>

TomD

unread,
Jan 20, 2003, 2:40:55 PM1/20/03
to

"Jim Patrick" <jpatric...@shentel.net> wrote in message
news:isbo2vo9jbcnrk3rq...@4ax.com...
<SNIPPED>

> It's also certainly possible to make a program (and get the executable
> to run with AutoCAD as an ARX) that would do what you want. But
> AutoCAD isn't --and won't be in the foreseeable future-- parametric.

I've done this, just for the sake of some testing, with VBA in Acad200i. It
works fine, and updates, I'm just not sure how to make it persist across
sessions, if that's even possible.


Tom Berger

unread,
Jan 20, 2003, 2:37:42 PM1/20/03
to
intel wrote:

> I am looking for a LISP ot some kind of tool which by usind a Pline
> on a closed area it will show me Its area size and if I am changing
> the Pline size the area will be accommodate accordingly,

http://www.archtools.de

Sorry, at the moment the software is in German language only. It is part
of a tool to calculate areas of floor plans. You can also insert the
summary of the area of selected rooms (a flat, an appartement ...), and
this area text is also automatically updated whenever you stretch a room
polyline. I am working on an english version at the moment.

Tom Berger

--
ArchTools: Architektur-Werkzeuge für AutoCAD (TM)
ArchDIM - architekturgerechte Bemaßung und Höhenkoten
ArchAREA - Flächenermittlung und Raumbuch nach DIN 277
Info und Demo unter http://www.archtools.de

Robert Ross

unread,
Jan 20, 2003, 2:54:48 PM1/20/03
to
if you are writing the autolisp yourself, think "associative hatching" and
"boundary polygon (bpoly command)" - retrieve data in the same respects....

"intel" <Yossix....@intel.com> wrote in message
news:b0h09n$93p$1...@news01.intel.com...

Detailing_Dude

unread,
Jan 20, 2003, 3:14:02 PM1/20/03
to
Tom erger, Can you let us know when you're done? Do you have an email list
or something?

--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"Tom Berger" <ber...@archtools.de> wrote in message
news:b0hj4i$va7$00$1...@news.t-online.com...

Detailing_Dude

unread,
Jan 20, 2003, 3:17:46 PM1/20/03
to
If you bring up the change properties dialog, it will update as you strecht.


--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"Robert Ross" <rr...@preferredworld.com> wrote in message
news:v2olena...@corp.supernews.com...

Tom Berger

unread,
Jan 21, 2003, 10:26:11 AM1/21/03
to
Detailing_Dude wrote:
> Tom erger, Can you let us know when you're done? Do you have an email
> list or something?

I am only sending infos to my existent user base, and as the software is
yet only in German language the infos are addressing the users in German
language as well. I will post infos to this NG as soon as I have a
product that is of interest to the NG.

Are you interested in an AEC area calculation and administration
application, or simply in associative polyline areas? It is a rather
simple task to get the area of a closed polyline, to create a text
entity which shows this area, and to bind this text entity to the
polyline via a reactor. That would not need more than perhaps 20 or 30
lines of LISP.

My application however does create database entries for each room using
the CI/SfB structure. Besides the CI/SfB categories the user can add
room data using individually defined categories. All CI/SfB and
individual database entries as well as user variables and of course
geometrical data (area, boundary length) can be shown in the room stamp,
and can be exported to speadsheet programs or database systems.

Tom Berger

unread,
Jan 21, 2003, 10:40:57 AM1/21/03
to
Jim Patrick wrote:

> So get software that does parametrics. Catia, Solidworks, Inventor,
> etc can do this with a little extra VBA code.

This has nothing to do with parametrics. It would simply be like
ordinary associative dimensions, just that the text would always reflect
the area size of the polyline, and not a length. Parametric geometry
would be a two-way associativity: changing the number in the dimension
text would modify the size of teh geometry and vice versa.

> It's also certainly possible to make a program (and get the executable
> to run with AutoCAD as an ARX) that would do what you want.

It would be very easy to create an associatve "area dimension", i.e. a
text entity which would always refelct the area of a polyline. The
associativity would simply be created via a object reactor. The complete
thing would not be more than 20 or 30 lines of LISP.

Tom Berger

unread,
Jan 21, 2003, 10:48:35 AM1/21/03
to
Jim Patrick wrote:

> It's also certainly possible to make a program (and get the executable
> to run with AutoCAD as an ARX) that would do what you want. But
> AutoCAD isn't --and won't be in the foreseeable future-- parametric.

... I almost forgot, some time ago I did a small sample to show how easy
parametric design could be done in AutoCAD. Simply download
www.archdim.de/reactorsample.lsp, load it into AutoCAD, and enter the
command "RSTART". This command will create a circle and a text entity
which shows the radius of the circle. Whenever you modify the circle,
the text will be updated, and whenever you modify the text value, the
circle will be updated.

Michael Bulatovich

unread,
Jan 21, 2003, 11:04:51 AM1/21/03
to

"Tom Berger" <ber...@archtools.de> wrote in message
news:b0jpn1$28p$00$1...@news.t-online.com...

> Jim Patrick wrote:
>
> > So get software that does parametrics. Catia, Solidworks, Inventor,
> > etc can do this with a little extra VBA code.
>
> This has nothing to do with parametrics. It would simply be like
> ordinary associative dimensions, just that the text would always reflect
> the area size of the polyline, and not a length. Parametric geometry
> would be a two-way associativity: changing the number in the dimension
> text would modify the size of teh geometry and vice versa.
>
> > It's also certainly possible to make a program (and get the executable
> > to run with AutoCAD as an ARX) that would do what you want.
>
> It would be very easy to create an associatve "area dimension", i.e. a
> text entity which would always refelct the area of a polyline. The
> associativity would simply be created via a object reactor. The complete
> thing would not be more than 20 or 30 lines of LISP.

I know I'm not alone in saying that I would love to see those 30 lines.

Detailing_Dude

unread,
Jan 21, 2003, 11:17:49 AM1/21/03
to
Tom,
That's exactly what i'm looking for. Can you do this with odd shapes? Only,
it only has to go one way. Modify the pline to change the text. I realize it
would just re-scale if you modify the text and I don't want that. What I'd
like is to be able to define rooms, adjust them to get the desired square
footage and then go into detail from there. Possible?

--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"Tom Berger" <ber...@archtools.de> wrote in message
news:b0jq5b$87k$03$1...@news.t-online.com...

Tom Berger

unread,
Jan 21, 2003, 11:18:50 AM1/21/03
to
Michael Bulatovich wrote:

> I know I'm not alone in saying that I would love to see those 30
> lines.

See my next post showing the link to my reactorsample.lsp at
www.archdim.de/reactorsample.lsp :-)

Anybody who has used AutoLISP for more than a single day can modify this
small sample from circle/radius to polyine/area (OK, modifying the
polyline when you enter a new value for the area would be a bit more
complex).

Tom Berger

unread,
Jan 21, 2003, 11:38:16 AM1/21/03
to
Detailing_Dude wrote:

> That's exactly what i'm looking for. Can you do this with odd shapes?
> Only, it only has to go one way.

Of course this could also be used for all entities which have an area
(closed polylines and splines, ellipses, circles, regions). You would
simply have to modify the code so that the text would not look for the
other entity's radius, but for it's area. And of course you could not do
it as a two-way parametric system, as you would need much more
information to resize a closed polyline to fit a given area (and it
would be impossible to modify a region).

> Modify the pline to change the text.
> I realize it would just re-scale if you modify the text and I don't
> want that. What I'd like is to be able to define rooms, adjust them
> to get the desired square footage and then go into detail from there.
> Possible?

How would you adjust a room to fit a given area? Even when the room
would be simply rectangular you have two parameteres which depend on
each other. If you want the room to be adjusted to 20 squere meters,
should it be transformed to 4 by 5 meters, or to 2 by 10 meters, or to
which of the infinite numbers of x/y relations, which would also define
a 20 sqm room? And then consider the more likely problem, that your room
is not rectangular ...

BTW - the sample code is just sample code. You would be better off to
use a combination of object reactor and editor reactor, and you would
need some more code to handle different problems (erasing one of the two
objects, copying the objects ...)

Michael Bulatovich

unread,
Jan 21, 2003, 1:16:22 PM1/21/03
to
Thanks for the sample. I will go over it when I find some time.

"Tom Berger" <ber...@archtools.de> wrote in message

news:b0jru2$u8g$05$1...@news.t-online.com...

Detailing_Dude

unread,
Jan 21, 2003, 2:29:54 PM1/21/03
to
If you figure it out Michael, don't forget me.

--
Cecil Hayden #1200
Parsons Detailing, Inc.
757.482.1122
Registered Users of:
AutoCAD, SSDCP, SDS/2, Steel Logic, Xsteel

"It isn't the hours you put in the work, but the work you put in the hours"

"Michael Bulatovich" <dont...@try.me> wrote in message
news:D7gX9.50733$_N5.4...@news20.bellglobal.com...

TomD

unread,
Jan 21, 2003, 4:05:25 PM1/21/03
to
I'll be looking at it, too. I've played with reactors in VBA, so I'm
hopeful I can follow it. ;)

If I get to anything interesting, I'll be sure to post.

"Detailing_Dude" <ce...@parsinsdetailing.hrcoxmail.com> wrote in message
news:SchX9.19708$8N.18...@news1.east.cox.net...

Tom Berger

unread,
Jan 21, 2003, 4:34:17 PM1/21/03
to
TomD wrote:
> I'll be looking at it, too. I've played with reactors in VBA, so I'm
> hopeful I can follow it. ;)
>
> If I get to anything interesting, I'll be sure to post.

OK, you got me. Here you have the assoziative area text. It works with
closed polylines and splines, circles and ellipses. There may be some
other entities you may use (3DFace, region ...), but I didn't test them.
You need to have the area object, the text object will be created
automatically. The command is ASSAREA

Tom Berger

;;;---- begin code

(defun c:assarea (/ input pline txtpt area text)
(command "._undo" "_group")
(if (setq
input (entsel "\npick closed Polyline/Spline/Circle/Ellipse: ")
)
(progn
(setq pline (car input)
txtpt (cadr input)
area (vlax-get-property (vlax-ename->vla-object pline) 'area)
)
(if (entmake (list
'(0 . "TEXT")
'(100 . "AcDbEntity")
'(67 . 0)
'(410 . "Model")
'(8 . "0")
'(100 . "AcDbText")
(cons 10 (trans txtpt 1 0))
(cons 40 (/ (getvar "viewsize" 20.0)))
(cons 1 (rtos area 2 2))
'(50 . 0.0)
'(41 . 1.0)
'(51 . 0.0)
'(7 . "Standard")
'(71 . 0)
'(72 . 0)
'(11 0.0 0.0 0.0)
'(210 0.0 0.0 0.0)
'(100 . "AcDbText")
'(73 . 0)
)
)
(setq text (entlast))
)
(if (and pline text)
(progn
(create-objectreactor
(list (vlax-ename->vla-object pline))
(list "MYAPPNAME" (vlax-ename->vla-object text))
)
)
)
)
)
(command "._undo" "_end")
(prin1)
)


(defun create-objectreactor (ownerobjects data / myreactor)
(setq myreactor
(VLR-OBJECT-Reactor
ownerobjects
data
'(
(:vlr-modified . updatefunction)
)
)
)
)

(defun updatefunction (firingobject
firedreactor event /
data area text
dependingentlist
)
(setq data (vlr-data firedreactor))
(setq area (vlax-get-property firingobject 'area))
(setq dependingentlist
(entget (vlax-vla-object->ename (cadr data))
)
)
(entmod (subst (cons 1 (rtos area 2 2))
(assoc 1 dependingentlist)
dependingentlist
)
)
(entupd (cdr (assoc -1 dependingentlist)))
)

(princ "\nEnter \"ASSAREA\" at the command prompt ...")
(prin1)

;;;---- end code

nils

unread,
Jan 22, 2003, 8:31:22 AM1/22/03
to

hi all,
pretty impressed by Tom's work.. will try it !

I'm using the good old areautil arx software from Cadstudio, it costed me 100$ and saved me 100's in work hours...
I can only recommend it since it not only links a line/polyline to a attribute, but it is able to work in stealth mode that allows click on line/click on attribute in a second, and also is able to vary the unit behind the coma, and update that whenever I want.... This combine with their neet excellink software makes working with surfaces pretty smooth..

Nils


Tom Berger

unread,
Jan 22, 2003, 9:02:51 AM1/22/03
to
nils wrote:

> pretty impressed by Tom's work.. will try it !

Thank you :-) But the real impressive thing is that programming reactors
is really simple stuff. I have to admit that I never understood
Autodesk's garden path sample, which comes with AutoCAD and is intended
to teach programming reactors. It is hopelessly complicated.

> I'm using the good old areautil arx software from Cadstudio, it
> costed me 100$ and saved me 100's in work hours...

... competition is on the way. More functionality, easier to use, and
less money :-) Stay tuned.

T:-)m Berger

jojo

unread,
Jan 22, 2003, 9:17:21 AM1/22/03
to

"Tom Berger" <ber...@archtools.de> wrote in message
news:b0kedg$2s6$04$1...@news.t-online.com...

Thank you Tom!!!
I'm going to plug this in right now and see if I can get it to work for
me!!!!

jojo

Jürgen Palme

unread,
Jan 22, 2003, 10:45:36 AM1/22/03
to
Tom Berger schrieb:
>
> ...

>
> ;;;---- begin code
>
> (defun c:assarea (/ input pline txtpt area text)
> (command "._undo" "_group")
> (if (setq
> input (entsel "\npick closed Polyline/Spline/Circle/Ellipse: ")
> )
> (progn
> (setq pline (car input)
> txtpt (cadr input)
> area (vlax-get-property (vlax-ename->vla-object pline) 'area)
> )
> (if (entmake (list
> '(0 . "TEXT")
> '(100 . "AcDbEntity")
> '(67 . 0)
> '(410 . "Model")
> '(8 . "0")
> '(100 . "AcDbText")
> (cons 10 (trans txtpt 1 0))
> (cons 40 (/ (getvar "viewsize" 20.0)))
> ...

The last line of the above cited lisp needs a little correction. It must
be:
(cons 40 (/ (getvar "viewsize") 20.0))


Regards
Juergen

Tom Berger

unread,
Jan 22, 2003, 11:30:03 AM1/22/03
to
Jürgen Palme wrote:

> The last line of the above cited lisp needs a little correction. It
> must be:
> (cons 40 (/ (getvar "viewsize") 20.0))

Thank you. That happens when you hack your code directly into your
newsclient :-)

Tom Berger

Jim Patrick

unread,
Jan 22, 2003, 12:47:22 PM1/22/03
to
In alt.cad.autocad, Tom Berger wrote:

>Thank you :-) But the real impressive thing is that programming reactors
>is really simple stuff. I have to admit that I never understood
>Autodesk's garden path sample, which comes with AutoCAD and is intended
>to teach programming reactors. It is hopelessly complicated.

Thank you, thank you, thank you for saying that!!
Perhaps there's hope for me yet. <G>

Michael Bulatovich

unread,
Jan 22, 2003, 2:34:04 PM1/22/03
to

"Jim Patrick" <jpatric...@shentel.net> wrote in message
news:79mt2vkj4nbd9t2t1...@4ax.com...

Now that there's three of us we could start a support group for those who
were led down, but could not follow, the garden path. (Idiomatic joke, Tom.)

Tom Berger

unread,
Jan 22, 2003, 2:49:33 PM1/22/03
to
Michael Bulatovich wrote:

> Now that there's three of us we could start a support group for those
> who were led down, but could not follow, the garden path. (Idiomatic
> joke, Tom.)

I have a garden path which is working perfectly well :-) It's up the
wall in front of my house: http://www.archtools.de/kontakt.html

Jim Patrick

unread,
Jan 22, 2003, 3:15:42 PM1/22/03
to
In alt.cad.autocad, Tom Berger wrote:

>Michael Bulatovich wrote:
>> Now that there's three of us we could start a support group for those
>> who were led down, but could not follow, the garden path. (Idiomatic
>> joke, Tom.)

>I have a garden path which is working perfectly well :-) It's up the
>wall in front of my house: http://www.archtools.de/kontakt.html

What in the world is growing from the pipes? Do the pipes still drain
(I'm assuming) rainwater, and if so how do the roots survive?

P.C.

unread,
Jan 22, 2003, 3:21:34 PM1/22/03
to
Hi

"Tom Berger" <ber...@archtools.de> skrev i en meddelelse
news:b0m8c5$lva$00$1...@news.t-online.com...

> Autodesk's garden path sample,

You are quite right, an AutoLisp expert would proberly do a neat matrix
calculation with two recursive functions doing the calculations of points to
place useless cement tubes
twice the speed of light being there before you even ask , ----- true Autodesk
could need some new dust and esp. when this show these exiting features that
simple , still I need to be good with a reasoable 3D program, but reactor
classes was more difficult than recurtion, and I never realy caught up with
these ------- please write some more :))
P.C.

Tom Berger

unread,
Jan 22, 2003, 3:40:30 PM1/22/03
to
Jim Patrick wrote:

> What in the world is growing from the pipes? Do the pipes still drain
> (I'm assuming) rainwater, and if so how do the roots survive?

Where do you see pipes? There are pillars made from red brickstone, and
russian whine is growing over them. Behind the pillars is my terrace,
and right now I am sitting behind the window looking out to the terrace
(OK, it's night now, and I am not looking out of the window). The
picture was taken in spring before the whine got green. The house now is
101 years old, and it seems that the whine is almost as old :-)

Tom Berger

Jim Patrick

unread,
Jan 22, 2003, 4:57:07 PM1/22/03
to
In alt.cad.autocad, Tom Berger wrote:

>Jim Patrick wrote:
>> What in the world is growing from the pipes? Do the pipes still drain
>> (I'm assuming) rainwater, and if so how do the roots survive?

>Where do you see pipes? There are pillars made from red brickstone, and
>russian whine is growing over them. Behind the pillars is my terrace,
>and right now I am sitting behind the window looking out to the terrace
>(OK, it's night now, and I am not looking out of the window). The
>picture was taken in spring before the whine got green. The house now is
>101 years old, and it seems that the whine is almost as old :-)

Russian whine. Thanks, it looks pretty. Reviewing the picture, to
the right of the exposed pillar, it appears like an old drainpipe
coming horizontally from the house. I see now that it is not a pipe,
but a horizontal behind the whine-covered pillar.

If you would make a VRML model of the house I wouldn't have gotten as
confused. <G>

Tom Berger

unread,
Jan 22, 2003, 5:11:28 PM1/22/03
to
Jim Patrick wrote:

> If you would make a VRML model of the house I wouldn't have gotten as
> confused. <G>

Next time, perhaps. I still have a copy of Canoma, which was bought and
killed by Adobe. It is quite easy to do 3D models and animations from
just a few photographs: http://www.canoma.com/ The problem is to take
photos from all sides, becasue the house is so steep up the hill.

Michael Bulatovich

unread,
Jan 22, 2003, 6:19:57 PM1/22/03
to
I deeply envy your architecture....

"Tom Berger" <ber...@archtools.de> wrote in message

news:b0msm2$3qf$07$1...@news.t-online.com...

Michael Bulatovich

unread,
Jan 22, 2003, 6:21:04 PM1/22/03
to
It's an arbour, Jim.

"Jim Patrick" <jpatric...@shentel.net> wrote in message

news:elut2vgrkvds68qf4...@4ax.com...

@ar7.com Michael Rounds

unread,
Jan 24, 2003, 12:04:34 PM1/24/03
to
Now if I add the line
(vlr-pers myreactor)
to the create-objectreactor function, this makes the reactor
persistant.

But when I close and reopen the drawing and stretch the polyline, I
get the error message
"error: no function definition: UPDATEFUNCTION"

How do I get the reactor to embed the functionality or automatically
load in order to be truly persistent? No fair adding code to the
acaddoc.lsp to force load on startup, I'm looking for portability.

Michael Rounds, AIA
mrounds (at) ar7 (dot) com


On Tue, 21 Jan 2003 22:34:17 +0100, "Tom Berger" <ber...@archtools.de>
wrote:

Tom Berger

unread,
Jan 24, 2003, 12:41:45 PM1/24/03
to
Michael Rounds wrote:
> Now if I add the line
> (vlr-pers myreactor)
> to the create-objectreactor function, this makes the reactor
> persistant.
>
> But when I close and reopen the drawing and stretch the polyline, I
> get the error message
> "error: no function definition: UPDATEFUNCTION"

The reactor becomes persistent, but not the reactor-function. You need
to load the LISP file together with the drawing file.

> How do I get the reactor to embed the functionality or automatically
> load in order to be truly persistent?

No way, never. OK, you could store the full LISP code in a dictionary
object and bound this to the reactor object, but even then you would
need some code to restore this LISP when you open your drawing file (I
did a similar trick some 10 years ago with my application objectiveCAD).
But you still have the old ways to automatically load your necessary
LISPs (ACAD.LSP, ACADDOC.LSP, MYMENU.MNL ...).

But I do not recommend to make reactors persistent. I do not have real
proof for it, but I have the feeling that these make AutoCAD much more
instable. And persistent reactors are a pain in the ass for the people
who take your drawing files and don't have the LISP code.

I make my reactors "persistent" thru XDATA which I add to the objects.
In the case of the "associative area dimension" I would use a unique
refhandle which I would stick as XDATA at the area-object and the
dimension-text. When a drawing file with these data is opened, my
application will load automatically (I am using the MNL file), and the
S::STARTUP function will check for objects with XDATA and restore the
non-persistent reactors.

Tom Berger

PS - you don't need to quote in full when answering. Your posts would be
much better readable when you would only quote the necessary parts.

jo...@fel.u-net.com.invalid

unread,
Jan 25, 2003, 2:18:41 PM1/25/03
to
On Wed, 22 Jan 2003 15:02:51 +0100, "Tom Berger" <ber...@archtools.de>
wrote:

>nils wrote:


>
>> pretty impressed by Tom's work.. will try it !
>
>Thank you :-) But the real impressive thing is that programming reactors
>is really simple stuff. I have to admit that I never understood
>Autodesk's garden path sample, which comes with AutoCAD and is intended
>to teach programming reactors. It is hopelessly complicated.

Hell, I never fully understood the original garden path sample that
predated reactors, DCL and (even) Windows.
So I'm really impressed.

The only trouble is; it doesn't work for me - yet.

John B

johnbogie btinternet.com
Put the "at" in the gap.

Tom Berger

unread,
Jan 25, 2003, 3:12:04 PM1/25/03
to
jo...@fel.u-net.com.invalid wrote:

> The only trouble is; it doesn't work for me - yet.

I did test it with a fixed text height, which for some of you may be an
inappropriate value. So I hacked another solution directly, and I made a
smal mistake. Jürgen already showed us the bug:

>>(cons 40 (/ (getvar "viewsize" 20.0)))

>> ...

> The last line of the above cited lisp needs a little correction. It
must
> be:

> (cons 40 (/ (getvar "viewsize") 20.0))

Tom Berger

jo...@fel.u-net.com.invalid

unread,
Jan 26, 2003, 7:48:02 AM1/26/03
to
On Sat, 25 Jan 2003 21:12:04 +0100, "Tom Berger" <ber...@archtools.de>
wrote:

>jo...@fel.u-net.com.invalid wrote:


>
>> The only trouble is; it doesn't work for me - yet.
>
>I did test it with a fixed text height, which for some of you may be an
>inappropriate value. So I hacked another solution directly, and I made a
>smal mistake. Jürgen already showed us the bug:
>
>>>(cons 40 (/ (getvar "viewsize" 20.0)))
>>> ...
>
>> The last line of the above cited lisp needs a little correction. It
>must
>> be:
>> (cons 40 (/ (getvar "viewsize") 20.0))
>
>Tom Berger

That fixed it.
Thanks to both you and Jürgen.
I can see that I need to do some studying.

Ta.

0 new messages