.NET

Reply
Active Contributor
Basha Sk
Posts: 43
Registered: ‎11-07-2006
Message 1 of 5 (134 Views)

Problem with UNDO & MREDO

134 Views, 4 Replies
02-13-2007 02:08 AM
Hi All,

I am using ADT and Xml. When an object ( Doors & Windows) is added, modified or deleted from the drawing then i am writing that information to the Xml file by using the Reactors. But when UNDO and REDO commands are used in between then is there any way to handle them just like reactors.

Thanks & Regards,
Basha
Mentor
MarkPendergraft
Posts: 385
Registered: ‎06-27-2005
Message 2 of 5 (134 Views)

Re: Problem with UNDO & MREDO

02-13-2007 07:55 AM in reply to: Basha Sk
I know you can set a commandflag at the beginning of your subm but i'm not sure if it disables undos during your command, or doesn't allow your command to be undone.
*Tony Tanzillo
Message 3 of 5 (134 Views)

Re: Problem with UNDO & MREDO

02-13-2007 12:09 PM in reply to: Basha Sk
IMHO, You're taking the wrong approach by using reactors.

It's far easier to just scan the database when it is saved,
and update your external data there.

The only time I need to track changes to objects in 'near-
real-time', is when I need to update a user interface (like
a floating palette) to keep the view it displays in sync with
the contents of the drawing.

But, if the purpose is only to update external data like your
scenario, the better way is to just do it once when the file is
saved.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5484625@discussion.autodesk.com...
Hi All,

I am using ADT and Xml. When an object ( Doors & Windows) is added, modified or deleted from the drawing then i am writing that information to the Xml file by using the Reactors. But when UNDO and REDO commands are used in between then is there any way to handle them just like reactors.

Thanks & Regards,
Basha
Active Contributor
Basha Sk
Posts: 43
Registered: ‎11-07-2006
Message 4 of 5 (133 Views)

Re: Problem with UNDO & MREDO

02-15-2007 02:36 AM in reply to: Basha Sk
Hi Tony,

Thanks for your kind response. Actually i have a xml file with all information of the drawing. I am updating that Xml file whenever an Object is added, deleted or modified using Reactors(ObjectAdded, ObjectErased etc..). Now my problem are ...............

1) when i delete an object or add multiple objects and issued Undo and Redo commands then how can i update my Xml file (i want to update my Xml file with the drawing itself).

2)I have attached XData to the Objects. Suppose if i delete an Object which is having some XData attached. If i Undo is it possible to Read that XData in the ObjectReappended method. I am getting error like "eWasOpenedForRead".

3)What do you mean by Scanning the Database.

Hope u definitely have answers for me.Thanks in Advance

Best Regards,
Basha
*Tony Tanzillo
Message 5 of 5 (134 Views)

Re: Problem with UNDO & MREDO

02-15-2007 07:01 PM in reply to: Basha Sk
>> I am updating that Xml file whenever an Object is added,
>> deleted or modified using Reactors(ObjectAdded, ObjectErased etc..).

Well, as I said previously, this approach to keeping
external data in-sync is flawed and unreliable.

>> What do you mean by Scanning the Database.

When the document is saved, you just scan the entire
drawing and extract what you need and update the
external data.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5487414@discussion.autodesk.com...
Hi Tony,

Thanks for your kind response. Actually i have a xml file with all information of the drawing. Now my problem are ...............

1) when i delete an object or add multiple objects and issued Undo and Redo commands then how can i update my Xml file (i want to update my Xml file with the drawing itself).

2)I have attached XData to the Objects. Suppose if i delete an Object which is having some XData attached. If i Undo is it possible to Read that XData in the ObjectReappended method. I am getting error like "eWasOpenedForRead".

3)What do you mean by Scanning the Database.

Hope u definitely have answers for me.Thanks in Advance

Best Regards,
Basha
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.