ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is realy object modified?

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
252 Views, 3 Replies

Is realy object modified?

Hi,

How to chek is object modified, because objectModified() event occurs when
object was opened, but it may be still the same 😞 I need only thows objects
witch let say coordinates changed (not just was opened and closed). Any
idea?
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

As far as i know, there's no way to directly find out if an object was
ACTUALLY modified. I've been struggling with this fact for a long time. In
my particular case, however, all i need to know is whether the object has
been moved or not. For that i store a point in my custom object -
m_pntLastPosition. Everytime the objectModified( ) function gets fired, i
check that variable. If my NEW point doesn't match the LAST one, then i
know the object has been moved. What's the specific property that you need
to be aware of?

Another possible solution that i considered was to override the functions in
my custom object that correspond to the properties i'm concerned about.
What i mean by that is that if i need to know if an object gets moved, i can
override the TransfromBy() function, and toggle a m_bWasModified boolean.
Then, when objectModified gets called, i can identify that some sort of
significant change was made.



"Mindaugas Bliudzius" wrote in message
news:EAB401FFD30640080421860B21AEFE90@in.WebX.maYIadrTaRb...
> Hi,
>
> How to chek is object modified, because objectModified() event occurs when
> object was opened, but it may be still the same 😞 I need only thows
objects
> witch let say coordinates changed (not just was opened and closed). Any
> idea?
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

Hi, thank's for reply,

The problem is that i need to retriangulate surface when point was modified
or deleted. It take a bit of time so i don't want regenerate surface if
someone just opened and closed that point. At first i removed kForWrite
(because this call event) from my program where i'm cheking objects and only
if i realy need to change objetc i used upgeradeOpen(). But still some other
program can do that 😞
The main reason why your replay is good, that now i know that there is no
straight way to do that 🙂 It is good to know that when you doing something
that there is no easier way 🙂 And thank's one more time for your
suggestions. I'll try to use them.


"Justavian" wrote in message
news:081E897285A91F8550B2AE63777F1EE6@in.WebX.maYIadrTaRb...
> As far as i know, there's no way to directly find out if an object was
> ACTUALLY modified. I've been struggling with this fact for a long time.
In
> my particular case, however, all i need to know is whether the object has
> been moved or not. For that i store a point in my custom object -
> m_pntLastPosition. Everytime the objectModified( ) function gets fired, i
> check that variable. If my NEW point doesn't match the LAST one, then i
> know the object has been moved. What's the specific property that you
need
> to be aware of?
>
> Another possible solution that i considered was to override the functions
in
> my custom object that correspond to the properties i'm concerned about.
> What i mean by that is that if i need to know if an object gets moved, i
can
> override the TransfromBy() function, and toggle a m_bWasModified boolean.
> Then, when objectModified gets called, i can identify that some sort of
> significant change was made.
>
>
>
> "Mindaugas Bliudzius" wrote in message
> news:EAB401FFD30640080421860B21AEFE90@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > How to chek is object modified, because objectModified() event occurs
when
> > object was opened, but it may be still the same 😞 I need only thows
> objects
> > witch let say coordinates changed (not just was opened and closed). Any
> > idea?
> >
> >
>
>
Message 4 of 4
Anonymous
in reply to: Anonymous

Mindaugas,

> The problem is that i need to retriangulate surface when point was
modified
> or deleted. It take a bit of time so i don't want regenerate surface if


Don't forget the undo function!

You might want to investigate overriding the AcDbDatabaseReactor reactor;

class dBaseReactor : public AcDbDatabaseReactor
{
public:
virtual void objectUnAppended(const AcDbDatabase* dwg, const
AcDbObject* dbObj);
virtual void objectAppended(const AcDbDatabase *pDwg, const
AcDbObject *pDbObj);
virtual void objectModified(const AcDbDatabase *pDwg, const
AcDbObject *pDbObj);
virtual void objectErased(const AcDbDatabase *pDwg, const
AcDbObject *pDbObj, Adesk::Boolean erased);
virtual void objectOpenedForModify(const AcDbDatabase* dwg, const
AcDbObject* dbObj);
};

and check in theses functions for your object!


Regards Gary
www.drcauto.com




"Mindaugas Bliudzius" wrote in message
news:2F10160818A1FEC46F7D72432162A33F@in.WebX.maYIadrTaRb...
> Hi, thank's for reply,
>
> The problem is that i need to retriangulate surface when point was
modified
> or deleted. It take a bit of time so i don't want regenerate surface if
> someone just opened and closed that point. At first i removed kForWrite
> (because this call event) from my program where i'm cheking objects and
only
> if i realy need to change objetc i used upgeradeOpen(). But still some
other
> program can do that 😞
> The main reason why your replay is good, that now i know that there is no
> straight way to do that 🙂 It is good to know that when you doing
something
> that there is no easier way 🙂 And thank's one more time for your
> suggestions. I'll try to use them.
>
>
> "Justavian" wrote in message
> news:081E897285A91F8550B2AE63777F1EE6@in.WebX.maYIadrTaRb...
> > As far as i know, there's no way to directly find out if an object was
> > ACTUALLY modified. I've been struggling with this fact for a long time.
> In
> > my particular case, however, all i need to know is whether the object
has
> > been moved or not. For that i store a point in my custom object -
> > m_pntLastPosition. Everytime the objectModified( ) function gets fired,
i
> > check that variable. If my NEW point doesn't match the LAST one, then i
> > know the object has been moved. What's the specific property that you
> need
> > to be aware of?
> >
> > Another possible solution that i considered was to override the
functions
> in
> > my custom object that correspond to the properties i'm concerned about.
> > What i mean by that is that if i need to know if an object gets moved, i
> can
> > override the TransfromBy() function, and toggle a m_bWasModified
boolean.
> > Then, when objectModified gets called, i can identify that some sort of
> > significant change was made.
> >
> >
> >
> > "Mindaugas Bliudzius" wrote in message
> > news:EAB401FFD30640080421860B21AEFE90@in.WebX.maYIadrTaRb...
> > > Hi,
> > >
> > > How to chek is object modified, because objectModified() event occurs
> when
> > > object was opened, but it may be still the same 😞 I need only thows
> > objects
> > > witch let say coordinates changed (not just was opened and closed).
Any
> > > idea?
> > >
> > >
> >
> >
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost