.NET

Reply
Mentor
Amremad
Posts: 216
Registered: ‎08-24-2010
Message 1 of 3 (120 Views)
Accepted Solution

ObjectModified event problem

120 Views, 2 Replies
08-16-2014 05:25 AM

hello every one

 

 

this is my code that i have with problem

 

 public class CADLogs : Autodesk.AutoCAD.Runtime.IExtensionApplication
    {
    public struct OpenedDocuments
    {
       public Autodesk.AutoCAD.DatabaseServices.Database cDocument ;
       public int Duration;
    }
    
    public Database  curDwg = new  Autodesk.AutoCAD.DatabaseServices.Database();
    public DocumentCollection DwgIO  = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;

    public CADLogs()
    {
        //curDwg.ObjectModified += curDwg_ObjectModified;

        DwgIO.DocumentBecameCurrent += DocumentBecameCurrent;
        DwgIO.DocumentCreated += DocumentCreated;
    }

    private void DocumentBecameCurrent(object sender, DocumentCollectionEventArgs e)
    {
        curDwg = e.Document.Database;
    }

    private void curDwg_ObjectModified(object sender, ObjectEventArgs e)
    {
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\n modified" + curDwg.Filename + ">>" + DateTime.Now.ToString());
    }
    private void DocumentCreated(object sender, DocumentCollectionEventArgs e)
    {
        e.Document.Database.ObjectModified += curDwg_ObjectModified;
        curDwg = e.Document.Database;
    }

    public void Initialize()
    {
        curDwg = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
        curDwg.ObjectModified += curDwg_ObjectModified;
    }

    public void Terminate()
    {
        //MessageBox.Show("terminate");
    }


    }

 

curDwg_ObjectModified works with first drawing only ,but when i open new drawing the event doesn't work , and i trying to solve this problem but i can't ..

can someone help me ??

 

this is the problem : if any person need to see the solve follow this subject

 

My Code work on 2014 and doens't Work on 2015

Mentor
Amremad
Posts: 216
Registered: ‎08-24-2010
Message 2 of 3 (94 Views)

Re: ObjectModified event problem

08-17-2014 05:59 AM in reply to: Amremad
any help please ?
Mentor
Amremad
Posts: 216
Registered: ‎08-24-2010
Message 3 of 3 (77 Views)

Re: ObjectModified event problem

08-18-2014 02:49 AM in reply to: Amremad

 

this is the problem : if any person need to see the solve follow this subject

 

My Code work on 2014 and doens't Work on 2015

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.