Is there such a thing as persistent event?

Is there such a thing as persistent event?

Anonymous
Not applicable
428 Views
9 Replies
Message 1 of 10

Is there such a thing as persistent event?

Anonymous
Not applicable
Hello,

I can create an object and attatch an event but how do I save it across dwg
editing sessions?

I can't find anything on this in Sutphin's book, acad help, or msvb help
Is this a stupid question?

Thanks
0 Likes
429 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Maybe I've been kill filtered for asking such stupid questions...?

markP wrote in message
news:A37534C9CB729227983FB97E9D1B9596@in.WebX.maYIadrTaRb...
> Hello,
>
> I can create an object and attatch an event but how do I save it across
dwg
> editing sessions?
>
> I can't find anything on this in Sutphin's book, acad help, or msvb help
> Is this a stupid question?
>
> Thanks
>
0 Likes
Message 3 of 10

Anonymous
Not applicable
Relax, it's not you. Silence typically indicates a total lack of
knowledge on everyone else's part. As far as I know, there is no such
thing as a persistent event in VBA.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"
by Joe Sutphin

"Mark Propst" wrote in message
news:84B057E89AE33B031360D8C9EE993D23@in.WebX.maYIadrTaRb...
> Maybe I've been kill filtered for asking such stupid questions...?
0 Likes
Message 4 of 10

Anonymous
Not applicable
So, Frank, if you can do persistent events in vlisp, how would you do the
equivalent in VBA?

My first guess is attach xdata to the object in which we're interested.
Then the VBA app can scan the database for objects with this xdata and set
object level events accordingly.

Am I completely out to lunch?

Mike

"Frank Oquendo" wrote in message
news:70C2B38053477897C1E77439E58EEFDA@in.WebX.maYIadrTaRb...
> Relax, it's not you. Silence typically indicates a total lack of
> knowledge on everyone else's part. As far as I know, there is no such
> thing as a persistent event in VBA.
>
> --
> http://www.acadx.com
> Win a free autographed copy of
> "AutoCAD 2000 VBA Programmer's Reference"
> by Joe Sutphin
>
> "Mark Propst" wrote in message
> news:84B057E89AE33B031360D8C9EE993D23@in.WebX.maYIadrTaRb...
> > Maybe I've been kill filtered for asking such stupid questions...?
>
0 Likes
Message 5 of 10

Anonymous
Not applicable
That sounds as good as any other approach, I suppose. It's odd that
there is no mechanism for it in VBA like the one in VLISP.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"
by Joe Sutphin

"Mike Weaver" wrote in message
news:602799062600F22791A8A017E1B09369@in.WebX.maYIadrTaRb...
> So, Frank, if you can do persistent events in vlisp, how would you
do the
> equivalent in VBA?
>
> My first guess is attach xdata to the object in which we're
interested.
> Then the VBA app can scan the database for objects with this xdata
and set
> object level events accordingly.
>
> Am I completely out to lunch?
>
> Mike
0 Likes
Message 6 of 10

Anonymous
Not applicable
Maybe you can help those of us completely vacant in lisp understand a little
more so possibly we can help you - can you explain a little what a
persistent event is? Like, what does it do?

"Mike Weaver" wrote in message
news:602799062600F22791A8A017E1B09369@in.WebX.maYIadrTaRb...
So, Frank, if you can do persistent events in vlisp, how would you do the
equivalent in VBA?

My first guess is attach xdata to the object in which we're interested.
Then the VBA app can scan the database for objects with this xdata and set
object level events accordingly.

Am I completely out to lunch?

Mike

"Frank Oquendo" wrote in message
news:70C2B38053477897C1E77439E58EEFDA@in.WebX.maYIadrTaRb...
> Relax, it's not you. Silence typically indicates a total lack of
> knowledge on everyone else's part. As far as I know, there is no such
> thing as a persistent event in VBA.
>
> --
> http://www.acadx.com
> Win a free autographed copy of
> "AutoCAD 2000 VBA Programmer's Reference"
> by Joe Sutphin
>
> "Mark Propst" wrote in message
> news:84B057E89AE33B031360D8C9EE993D23@in.WebX.maYIadrTaRb...
> > Maybe I've been kill filtered for asking such stupid questions...?
>
0 Likes
Message 7 of 10

Anonymous
Not applicable
A laborious but very smart idea, Mike.

Greetings,
--
Henk
0 Likes
Message 8 of 10

Anonymous
Not applicable
Kevin,
a persistent event is apparently a figment of my imagination per the above
replies to my orig. post.
Since you're offering to help I assume you know what an event is. ie attach
an event to an object.
The 'persistence' issue is that I would like that event to remain connected
to that object after the dwg is saved, closed, and reopened.
Which vba events do not do.

The corollary to lisp is that there is a thing called a reactor in lisp
which is basically what is called an event in vba, i.e. attach a routine to
an object and specify a condition which if it occurs to that object, should
call that function. These reactors also disappear on closing of the dwg
except there is an option to make them persistent which option does not seem
to exist for events in vba.

My original idea for a workaround (see re: post "How to make events
persistent" mar 6) was to save entity data in ldata, xdata, or dictionary
and then reattach events each time dwg was opened. I thought it was
probably another of my many dumb ideas until it was re-iterated by Mike
Weaver in this thread and commended by Henk afterwards, so maybe it's not so
dumb.
Now to figure out how to do it....

Or more to the point, if it's so convoluted to have to do such a simple
thing in vba, am I embarking down the wrong road by trying to learn vba as
preparation for writing a routine to use in my work which will be around two
years in the writing (given my slow learning abilities) and which will
necessitate much saving of information on possibly many objects in the
drawing and many various events or reactions necessary???
Should I be learning objectarx instead??/

I tried starting to learn c++ in preparation to learning Objectarx a couple
years ago and am still trying to get through the second book and have not
even begun to write c++ routines yet, it's soooo deep to my shallow mind!!!
Any help appreciated,
Thanks
Mark

Kevin Terry wrote in message
news:04833F67E6EA5E2CFD7448144DF91B45@in.WebX.maYIadrTaRb...
> Maybe you can help those of us completely vacant in lisp understand a
little
> more so possibly we can help you - can you explain a little what a
> persistent event is? Like, what does it do?
>
0 Likes
Message 9 of 10

Anonymous
Not applicable
Frank,
Thanks for the response,
I'm much more relaxed now...zzzzz 🙂
Mark

Frank Oquendo wrote in message
news:70C2B38053477897C1E77439E58EEFDA@in.WebX.maYIadrTaRb...
> Relax, it's not you. Silence typically indicates a total lack of
> knowledge on everyone else's part. As far as I know, there is no such
> thing as a persistent event in VBA.
>
> --
> http://www.acadx.com
> Win a free autographed copy of
> "AutoCAD 2000 VBA Programmer's Reference"
> by Joe Sutphin
>
> "Mark Propst" wrote in message
> news:84B057E89AE33B031360D8C9EE993D23@in.WebX.maYIadrTaRb...
> > Maybe I've been kill filtered for asking such stupid questions...?
>
0 Likes
Message 10 of 10

Anonymous
Not applicable
I see now. There is such a thing as a persistent reference, which you can
tie to an object using vba. Once this was done, then possibly a start-up
routine could look at these references and if something has changed between
the objects, then code could run. I don't have much experience with this
sort of thing, I've only played around with the persistent references out of
curiosity. Without knowing exactly what sorts of things you want to
accomplish, I can't offer much more than that. I would be interested in
hearing more about your project though, feel free to post add'l info and
some minds greater than mine might see a clear path for you.
Kevin

"markP" wrote in message
news:8F98B6B4DC8BCB3A7162BA074DAC876B@in.WebX.maYIadrTaRb...
Kevin,
a persistent event is apparently a figment of my imagination per the above
replies to my orig. post.
Since you're offering to help I assume you know what an event is. ie attach
an event to an object.
The 'persistence' issue is that I would like that event to remain connected
to that object after the dwg is saved, closed, and reopened.
Which vba events do not do.

The corollary to lisp is that there is a thing called a reactor in lisp
which is basically what is called an event in vba, i.e. attach a routine to
an object and specify a condition which if it occurs to that object, should
call that function. These reactors also disappear on closing of the dwg
except there is an option to make them persistent which option does not seem
to exist for events in vba.

My original idea for a workaround (see re: post "How to make events
persistent" mar 6) was to save entity data in ldata, xdata, or dictionary
and then reattach events each time dwg was opened. I thought it was
probably another of my many dumb ideas until it was re-iterated by Mike
Weaver in this thread and commended by Henk afterwards, so maybe it's not so
dumb.
Now to figure out how to do it....

Or more to the point, if it's so convoluted to have to do such a simple
thing in vba, am I embarking down the wrong road by trying to learn vba as
preparation for writing a routine to use in my work which will be around two
years in the writing (given my slow learning abilities) and which will
necessitate much saving of information on possibly many objects in the
drawing and many various events or reactions necessary???
Should I be learning objectarx instead??/

I tried starting to learn c++ in preparation to learning Objectarx a couple
years ago and am still trying to get through the second book and have not
even begun to write c++ routines yet, it's soooo deep to my shallow mind!!!
Any help appreciated,
Thanks
Mark

Kevin Terry wrote in message
news:04833F67E6EA5E2CFD7448144DF91B45@in.WebX.maYIadrTaRb...
> Maybe you can help those of us completely vacant in lisp understand a
little
> more so possibly we can help you - can you explain a little what a
> persistent event is? Like, what does it do?
>
0 Likes