object events do not fire

object events do not fire

Anonymous
Not applicable
590 Views
8 Replies
Message 1 of 9

object events do not fire

Anonymous
Not applicable
Using a VB DLL, I'm creating a class array of acad documents
to be able to have documents level events for multiple drawings

I know this is a kludge, but for what I'm doing is working fine

If the user opens a document, I redim the array and add
the opened document to the array. This works fine also.
All the events for this drawing fire when they should.

The only problem I'm having is when a New document is created
I add it to the array, and it fires the document_activate event
as soon as I add it to the class array.
But other events like object_modified are not being fired.
If I close and open the document, then all events fire just fine.

Any idea why this could be happening ?

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
0 Likes
591 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 3 of 9

Anonymous
Not applicable
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 4 of 9

Anonymous
Not applicable
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 5 of 9

Anonymous
Not applicable
Thanks Joe.
I haven't seen your routine but it probably
uses the same mechanism as the one I wrote
where I have a class with a public acad document
declared with events, and then a doc array that
holds the classes, one for each opened dwg
in the session. I believe this was also posted in ADN.

This works fine. When a document is added to the array
using the application's EndOpen event
each document responds to
all document and object level events
for existing objects and new objects on each dwg.

But when I add a new document in the
application's newdrawing event
I only get document level events
NOT object level events.


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850358@discussion.autodesk.com...
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 6 of 9

Anonymous
Not applicable
Aren't object level events specific to an object and have to assigned as
such. The only events I think are automatic are document level?

Joe
--

"Jorge Jimenez" wrote in message
news:4850489@discussion.autodesk.com...
Thanks Joe.
I haven't seen your routine but it probably
uses the same mechanism as the one I wrote
where I have a class with a public acad document
declared with events, and then a doc array that
holds the classes, one for each opened dwg
in the session. I believe this was also posted in ADN.

This works fine. When a document is added to the array
using the application's EndOpen event
each document responds to
all document and object level events
for existing objects and new objects on each dwg.

But when I add a new document in the
application's newdrawing event
I only get document level events
NOT object level events.


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850358@discussion.autodesk.com...
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 7 of 9

Anonymous
Not applicable
Well yes, sorry about the wrong choice of words.
What I'm reffering to are the doc events that are object related
such as objectmodified and objectadded.

As it's working right now
when I open an existing dwg and add it to the class array
all document level events do fire including the ones related to objects
such as objectmodified and objectadded

That is not happening when a NEW doc
is created and added to the class array
The doc object related events do not fire
the rest DO fire, such as activate and close.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


"Joe Sutphin" wrote in message
news:4850705@discussion.autodesk.com...
Aren't object level events specific to an object and have to assigned as
such. The only events I think are automatic are document level?

Joe
--

"Jorge Jimenez" wrote in message
news:4850489@discussion.autodesk.com...
Thanks Joe.
I haven't seen your routine but it probably
uses the same mechanism as the one I wrote
where I have a class with a public acad document
declared with events, and then a doc array that
holds the classes, one for each opened dwg
in the session. I believe this was also posted in ADN.

This works fine. When a document is added to the array
using the application's EndOpen event
each document responds to
all document and object level events
for existing objects and new objects on each dwg.

But when I add a new document in the
application's newdrawing event
I only get document level events
NOT object level events.


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850358@discussion.autodesk.com...
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 8 of 9

Anonymous
Not applicable
Wait a minute, you're in a VB which means nothing is automatic. All events
have to instantiated before you can use them.

Joe
--

"Jorge Jimenez" wrote in message
news:4850752@discussion.autodesk.com...
Well yes, sorry about the wrong choice of words.
What I'm reffering to are the doc events that are object related
such as objectmodified and objectadded.

As it's working right now
when I open an existing dwg and add it to the class array
all document level events do fire including the ones related to objects
such as objectmodified and objectadded

That is not happening when a NEW doc
is created and added to the class array
The doc object related events do not fire
the rest DO fire, such as activate and close.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


"Joe Sutphin" wrote in message
news:4850705@discussion.autodesk.com...
Aren't object level events specific to an object and have to assigned as
such. The only events I think are automatic are document level?

Joe
--

"Jorge Jimenez" wrote in message
news:4850489@discussion.autodesk.com...
Thanks Joe.
I haven't seen your routine but it probably
uses the same mechanism as the one I wrote
where I have a class with a public acad document
declared with events, and then a doc array that
holds the classes, one for each opened dwg
in the session. I believe this was also posted in ADN.

This works fine. When a document is added to the array
using the application's EndOpen event
each document responds to
all document and object level events
for existing objects and new objects on each dwg.

But when I add a new document in the
application's newdrawing event
I only get document level events
NOT object level events.


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850358@discussion.autodesk.com...
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes
Message 9 of 9

Anonymous
Not applicable
The class has a variable of the type acaddocument wich is dimmed with
events.
Each document that is opened is added to the class array
and ALL their events fire just fine.
INCLUDING all object related document level events
for EVERY openned drawing.

If a NEW document is added, NO "object related" document level events fire.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850863@discussion.autodesk.com...
Wait a minute, you're in a VB which means nothing is automatic. All events
have to instantiated before you can use them.

Joe
--

"Jorge Jimenez" wrote in message
news:4850752@discussion.autodesk.com...
Well yes, sorry about the wrong choice of words.
What I'm reffering to are the doc events that are object related
such as objectmodified and objectadded.

As it's working right now
when I open an existing dwg and add it to the class array
all document level events do fire including the ones related to objects
such as objectmodified and objectadded

That is not happening when a NEW doc
is created and added to the class array
The doc object related events do not fire
the rest DO fire, such as activate and close.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


"Joe Sutphin" wrote in message
news:4850705@discussion.autodesk.com...
Aren't object level events specific to an object and have to assigned as
such. The only events I think are automatic are document level?

Joe
--

"Jorge Jimenez" wrote in message
news:4850489@discussion.autodesk.com...
Thanks Joe.
I haven't seen your routine but it probably
uses the same mechanism as the one I wrote
where I have a class with a public acad document
declared with events, and then a doc array that
holds the classes, one for each opened dwg
in the session. I believe this was also posted in ADN.

This works fine. When a document is added to the array
using the application's EndOpen event
each document responds to
all document and object level events
for existing objects and new objects on each dwg.

But when I add a new document in the
application's newdrawing event
I only get document level events
NOT object level events.


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Joe Sutphin" wrote in message
news:4850358@discussion.autodesk.com...
I wrote a routine on this subject years ago and it was posted on
www.acadx.com. However, I Frank Oquendo has since given it up for adoption.

Joe
--

"Jorge Jimenez" wrote in message
news:4849989@discussion.autodesk.com...
Uhmm, interesting. I'll give it a try.

But I been thinking,
I set the new document in the application newdrawing event
When the setting occurs, the document seems to NOT have a database yet
So maybe that's why the object does respond to all document level events
such as activate and close, but not to object level events such as
object_modified.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Mike Tuersley" wrote in message
news:4849970@discussion.autodesk.com...
No idea but try using a collection instead of an array. I use the same
technique with a collection and have not seen this problem.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
0 Likes