How to how many objects AutoCAd is going to delete?

How to how many objects AutoCAd is going to delete?

Anonymous
Not applicable
427 Views
6 Replies
Message 1 of 7

How to how many objects AutoCAd is going to delete?

Anonymous
Not applicable
Hi,

I need to modify my drawing after point is deleted, by if user selects
not one point but a lot, then it is
crazy to modify a drawing after each objectErased(), because take a lot of
time to modify my drawing, so is there any way to now how many points it's
selected to delete or maybe the end of delete operation?

Thank's
0 Likes
428 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
You could check what the current selection set is by using
acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the first
objectErased. With that you could assemble a total number of objects being
erased, and perhaps you could increment a global variable to figure out
whether you were on the last one.

Another (more complicated) solution is to use a message handler. Create a
CWnd derived class that can receive some sort of user message (like
WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you use
PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather than
using SendMessage, the WM_MYENT_ERASED messages won't get processed
immediately. What this means is that those messages will build up in the
message queue for that CWnd derived class. When AutoCAD gets finished
processing all of the objectErased() messages, that's when the first of the
WM_MYENT_ERASED messages will begin being processed. In your handler for
that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED messages
that have been posted. You can then do whatever processing needs to be done
in a bulk format.

There may be easier ways than the one i just listed, but i've found a lot of
uses for that procedure. I have an application that does a LOT of database
operations. Those operations are triggered by things that happen in the
drawing. Say a move operation can cause my app to tag into a database and
check certain values. If 100 objects are moved at once, it would access the
database 100 different times (since i'd detect that move using a reactor
that would fire for each object). Using this message handler technique, i
can bulk process all 100 objects with a single (albeit long) SQL statement.
Needless to say this is significantly faster.

-Rich


"Mindaugas Bliudzius" wrote in message
news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> Hi,
>
> I need to modify my drawing after point is deleted, by if user selects
> not one point but a lot, then it is
> crazy to modify a drawing after each objectErased(), because take a lot of
> time to modify my drawing, so is there any way to now how many points it's
> selected to delete or maybe the end of delete operation?
>
> Thank's
>
>
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thank's !!!

"Justavian" wrote in message
news:25430528AC7FB2969315F82B1C93098C@in.WebX.maYIadrTaRb...
> You could check what the current selection set is by using
> acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the first
> objectErased. With that you could assemble a total number of objects
being
> erased, and perhaps you could increment a global variable to figure out
> whether you were on the last one.
>
> Another (more complicated) solution is to use a message handler. Create a
> CWnd derived class that can receive some sort of user message (like
> WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you use
> PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather than
> using SendMessage, the WM_MYENT_ERASED messages won't get processed
> immediately. What this means is that those messages will build up in the
> message queue for that CWnd derived class. When AutoCAD gets finished
> processing all of the objectErased() messages, that's when the first of
the
> WM_MYENT_ERASED messages will begin being processed. In your handler for
> that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED messages
> that have been posted. You can then do whatever processing needs to be
done
> in a bulk format.
>
> There may be easier ways than the one i just listed, but i've found a lot
of
> uses for that procedure. I have an application that does a LOT of
database
> operations. Those operations are triggered by things that happen in the
> drawing. Say a move operation can cause my app to tag into a database and
> check certain values. If 100 objects are moved at once, it would access
the
> database 100 different times (since i'd detect that move using a reactor
> that would fire for each object). Using this message handler technique, i
> can bulk process all 100 objects with a single (albeit long) SQL
statement.
> Needless to say this is significantly faster.
>
> -Rich
>
>
> "Mindaugas Bliudzius" wrote in message
> news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > I need to modify my drawing after point is deleted, by if user
selects
> > not one point but a lot, then it is
> > crazy to modify a drawing after each objectErased(), because take a lot
of
> > time to modify my drawing, so is there any way to now how many points
it's
> > selected to delete or maybe the end of delete operation?
> >
> > Thank's
> >
> >
>
>
0 Likes
Message 4 of 7

Anonymous
Not applicable
Hi,

I did second way, everything now cool, just when AutoCAD finished his
job(deleting), i need to move mouse little bit to get started whith my
message handle :((( Maybe you know what can be the problem?

Thank's


"Justavian" wrote in message
news:25430528AC7FB2969315F82B1C93098C@in.WebX.maYIadrTaRb...
> You could check what the current selection set is by using
> acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the first
> objectErased. With that you could assemble a total number of objects
being
> erased, and perhaps you could increment a global variable to figure out
> whether you were on the last one.
>
> Another (more complicated) solution is to use a message handler. Create a
> CWnd derived class that can receive some sort of user message (like
> WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you use
> PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather than
> using SendMessage, the WM_MYENT_ERASED messages won't get processed
> immediately. What this means is that those messages will build up in the
> message queue for that CWnd derived class. When AutoCAD gets finished
> processing all of the objectErased() messages, that's when the first of
the
> WM_MYENT_ERASED messages will begin being processed. In your handler for
> that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED messages
> that have been posted. You can then do whatever processing needs to be
done
> in a bulk format.
>
> There may be easier ways than the one i just listed, but i've found a lot
of
> uses for that procedure. I have an application that does a LOT of
database
> operations. Those operations are triggered by things that happen in the
> drawing. Say a move operation can cause my app to tag into a database and
> check certain values. If 100 objects are moved at once, it would access
the
> database 100 different times (since i'd detect that move using a reactor
> that would fire for each object). Using this message handler technique, i
> can bulk process all 100 objects with a single (albeit long) SQL
statement.
> Needless to say this is significantly faster.
>
> -Rich
>
>
> "Mindaugas Bliudzius" wrote in message
> news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > I need to modify my drawing after point is deleted, by if user
selects
> > not one point but a lot, then it is
> > crazy to modify a drawing after each objectErased(), because take a lot
of
> > time to modify my drawing, so is there any way to now how many points
it's
> > selected to delete or maybe the end of delete operation?
> >
> > Thank's
> >
> >
>
>
0 Likes
Message 5 of 7

Anonymous
Not applicable
Hmmm.... i don't have a problem with that - but you might want to try to
fake out AutoCAD. Send it a mouse move message, or a button down message.
Try adding this:
::PostMessage(adsw_acadDocWnd(),WM_LBUTTONDOWN,NULL,NULL);

I use that little call to force Acad to go into my point filter. In my
case, i'm using the mouse wheel perform various additional functions.
However, ACAD's point filter doesn't care about the mouse wheel, so i had to
fool into thinking something was happening like that.

By the way - i'm impressed you got that up and running so quickly! Good
job... Let me know if i can help ya anymore.

-Rich



"Mindaugas Bliudzius" wrote in message
news:83517759AF7CC17459338980340C13A9@in.WebX.maYIadrTaRb...
> Hi,
>
> I did second way, everything now cool, just when AutoCAD finished his
> job(deleting), i need to move mouse little bit to get started whith my
> message handle :((( Maybe you know what can be the problem?
>
> Thank's
>
>
> "Justavian" wrote in message
> news:25430528AC7FB2969315F82B1C93098C@in.WebX.maYIadrTaRb...
> > You could check what the current selection set is by using
> > acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the first
> > objectErased. With that you could assemble a total number of objects
> being
> > erased, and perhaps you could increment a global variable to figure out
> > whether you were on the last one.
> >
> > Another (more complicated) solution is to use a message handler. Create
a
> > CWnd derived class that can receive some sort of user message (like
> > WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you use
> > PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather
than
> > using SendMessage, the WM_MYENT_ERASED messages won't get processed
> > immediately. What this means is that those messages will build up in
the
> > message queue for that CWnd derived class. When AutoCAD gets finished
> > processing all of the objectErased() messages, that's when the first of
> the
> > WM_MYENT_ERASED messages will begin being processed. In your handler
for
> > that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED
messages
> > that have been posted. You can then do whatever processing needs to be
> done
> > in a bulk format.
> >
> > There may be easier ways than the one i just listed, but i've found a
lot
> of
> > uses for that procedure. I have an application that does a LOT of
> database
> > operations. Those operations are triggered by things that happen in the
> > drawing. Say a move operation can cause my app to tag into a database
and
> > check certain values. If 100 objects are moved at once, it would access
> the
> > database 100 different times (since i'd detect that move using a reactor
> > that would fire for each object). Using this message handler technique,
i
> > can bulk process all 100 objects with a single (albeit long) SQL
> statement.
> > Needless to say this is significantly faster.
> >
> > -Rich
> >
> >
> > "Mindaugas Bliudzius" wrote in message
> > news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> > > Hi,
> > >
> > > I need to modify my drawing after point is deleted, by if user
> selects
> > > not one point but a lot, then it is
> > > crazy to modify a drawing after each objectErased(), because take a
lot
> of
> > > time to modify my drawing, so is there any way to now how many points
> it's
> > > selected to delete or maybe the end of delete operation?
> > >
> > > Thank's
> > >
> > >
> >
> >
>
>
0 Likes
Message 6 of 7

Anonymous
Not applicable
Hi,

Sorry for false alarm 🙂 Actualy my message handle is called (i don't know
why i thougt it not :(, maybe i work to hard 🙂 But the problem was that
AutoCAD need repaint and as always i forgot how to do that, so i needed a
little bit time to remember and then add few lines to my message handler :

acedGetAcadFrame()->SetFocus();

acedUpdateDisplay();

acedGetAcadFrame()->SetFocus();

I always forgot to add the last line(and start searching another way :).
Maybe you know why i need 2 SetFocus() call's to force autocad update it's
window, or maybe there is another way?


"Justavian" wrote in message
news:BDD7BBA9820629DD304F128E3772378D@in.WebX.maYIadrTaRb...
> Hmmm.... i don't have a problem with that - but you might want to try to
> fake out AutoCAD. Send it a mouse move message, or a button down message.
> Try adding this:
> ::PostMessage(adsw_acadDocWnd(),WM_LBUTTONDOWN,NULL,NULL);
>
> I use that little call to force Acad to go into my point filter. In my
> case, i'm using the mouse wheel perform various additional functions.
> However, ACAD's point filter doesn't care about the mouse wheel, so i had
to
> fool into thinking something was happening like that.
>
> By the way - i'm impressed you got that up and running so quickly! Good
> job... Let me know if i can help ya anymore.
>
> -Rich
>
>
>
> "Mindaugas Bliudzius" wrote in message
> news:83517759AF7CC17459338980340C13A9@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > I did second way, everything now cool, just when AutoCAD finished his
> > job(deleting), i need to move mouse little bit to get started whith my
> > message handle :((( Maybe you know what can be the problem?
> >
> > Thank's
> >
> >
> > "Justavian" wrote in message
> > news:25430528AC7FB2969315F82B1C93098C@in.WebX.maYIadrTaRb...
> > > You could check what the current selection set is by using
> > > acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the
first
> > > objectErased. With that you could assemble a total number of objects
> > being
> > > erased, and perhaps you could increment a global variable to figure
out
> > > whether you were on the last one.
> > >
> > > Another (more complicated) solution is to use a message handler.
Create
> a
> > > CWnd derived class that can receive some sort of user message (like
> > > WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you
use
> > > PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather
> than
> > > using SendMessage, the WM_MYENT_ERASED messages won't get processed
> > > immediately. What this means is that those messages will build up in
> the
> > > message queue for that CWnd derived class. When AutoCAD gets finished
> > > processing all of the objectErased() messages, that's when the first
of
> > the
> > > WM_MYENT_ERASED messages will begin being processed. In your handler
> for
> > > that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED
> messages
> > > that have been posted. You can then do whatever processing needs to
be
> > done
> > > in a bulk format.
> > >
> > > There may be easier ways than the one i just listed, but i've found a
> lot
> > of
> > > uses for that procedure. I have an application that does a LOT of
> > database
> > > operations. Those operations are triggered by things that happen in
the
> > > drawing. Say a move operation can cause my app to tag into a database
> and
> > > check certain values. If 100 objects are moved at once, it would
access
> > the
> > > database 100 different times (since i'd detect that move using a
reactor
> > > that would fire for each object). Using this message handler
technique,
> i
> > > can bulk process all 100 objects with a single (albeit long) SQL
> > statement.
> > > Needless to say this is significantly faster.
> > >
> > > -Rich
> > >
> > >
> > > "Mindaugas Bliudzius" wrote in message
> > > news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> > > > Hi,
> > > >
> > > > I need to modify my drawing after point is deleted, by if user
> > selects
> > > > not one point but a lot, then it is
> > > > crazy to modify a drawing after each objectErased(), because take a
> lot
> > of
> > > > time to modify my drawing, so is there any way to now how many
points
> > it's
> > > > selected to delete or maybe the end of delete operation?
> > > >
> > > > Thank's
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 7 of 7

Anonymous
Not applicable
actrTransactionManager->queueForGraphicsFlush();
actrTransactionManager->flushGraphics();
acedUpdateDisplay();


--
-----------------------------------------------------
Rich Priddy
Director of Desktop Development
Living Workplace Corporation
(240) 683-6060
FAX: (240) 683-6070

"Mindaugas Bliudzius" wrote in message
news:98D603BD0C53AA680AFCB55A22171067@in.WebX.maYIadrTaRb...
> Hi,
>
> Sorry for false alarm 🙂 Actualy my message handle is called (i don't know
> why i thougt it not :(, maybe i work to hard 🙂 But the problem was that
> AutoCAD need repaint and as always i forgot how to do that, so i needed a
> little bit time to remember and then add few lines to my message handler :
>
> acedGetAcadFrame()->SetFocus();
>
> acedUpdateDisplay();
>
> acedGetAcadFrame()->SetFocus();
>
> I always forgot to add the last line(and start searching another way :).
> Maybe you know why i need 2 SetFocus() call's to force autocad update it's
> window, or maybe there is another way?
>
>
> "Justavian" wrote in message
> news:BDD7BBA9820629DD304F128E3772378D@in.WebX.maYIadrTaRb...
> > Hmmm.... i don't have a problem with that - but you might want to try to
> > fake out AutoCAD. Send it a mouse move message, or a button down
message.
> > Try adding this:
> > ::PostMessage(adsw_acadDocWnd(),WM_LBUTTONDOWN,NULL,NULL);
> >
> > I use that little call to force Acad to go into my point filter. In my
> > case, i'm using the mouse wheel perform various additional functions.
> > However, ACAD's point filter doesn't care about the mouse wheel, so i
had
> to
> > fool into thinking something was happening like that.
> >
> > By the way - i'm impressed you got that up and running so quickly! Good
> > job... Let me know if i can help ya anymore.
> >
> > -Rich
> >
> >
> >
> > "Mindaugas Bliudzius" wrote in message
> > news:83517759AF7CC17459338980340C13A9@in.WebX.maYIadrTaRb...
> > > Hi,
> > >
> > > I did second way, everything now cool, just when AutoCAD finished his
> > > job(deleting), i need to move mouse little bit to get started whith my
> > > message handle :((( Maybe you know what can be the problem?
> > >
> > > Thank's
> > >
> > >
> > > "Justavian" wrote in message
> > > news:25430528AC7FB2969315F82B1C93098C@in.WebX.maYIadrTaRb...
> > > > You could check what the current selection set is by using
> > > > acedSSGet("I",NULL,NULL,NULL,ssname) - you could check this on the
> first
> > > > objectErased. With that you could assemble a total number of
objects
> > > being
> > > > erased, and perhaps you could increment a global variable to figure
> out
> > > > whether you were on the last one.
> > > >
> > > > Another (more complicated) solution is to use a message handler.
> Create
> > a
> > > > CWnd derived class that can receive some sort of user message (like
> > > > WM_MYENT_ERASED). Everytime your objectErased() fucntion fires, you
> use
> > > > PostMessage(WM_MYENT_ERASED, wParam, lParam). By posting it, rather
> > than
> > > > using SendMessage, the WM_MYENT_ERASED messages won't get processed
> > > > immediately. What this means is that those messages will build up
in
> > the
> > > > message queue for that CWnd derived class. When AutoCAD gets
finished
> > > > processing all of the objectErased() messages, that's when the first
> of
> > > the
> > > > WM_MYENT_ERASED messages will begin being processed. In your
handler
> > for
> > > > that message, use PeekMessage() to get ALL of the WM_MYENT_ERASED
> > messages
> > > > that have been posted. You can then do whatever processing needs to
> be
> > > done
> > > > in a bulk format.
> > > >
> > > > There may be easier ways than the one i just listed, but i've found
a
> > lot
> > > of
> > > > uses for that procedure. I have an application that does a LOT of
> > > database
> > > > operations. Those operations are triggered by things that happen in
> the
> > > > drawing. Say a move operation can cause my app to tag into a
database
> > and
> > > > check certain values. If 100 objects are moved at once, it would
> access
> > > the
> > > > database 100 different times (since i'd detect that move using a
> reactor
> > > > that would fire for each object). Using this message handler
> technique,
> > i
> > > > can bulk process all 100 objects with a single (albeit long) SQL
> > > statement.
> > > > Needless to say this is significantly faster.
> > > >
> > > > -Rich
> > > >
> > > >
> > > > "Mindaugas Bliudzius" wrote in message
> > > > news:92620D927A808C5C031539330C40D235@in.WebX.maYIadrTaRb...
> > > > > Hi,
> > > > >
> > > > > I need to modify my drawing after point is deleted, by if user
> > > selects
> > > > > not one point but a lot, then it is
> > > > > crazy to modify a drawing after each objectErased(), because take
a
> > lot
> > > of
> > > > > time to modify my drawing, so is there any way to now how many
> points
> > > it's
> > > > > selected to delete or maybe the end of delete operation?
> > > > >
> > > > > Thank's
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes