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

ObjectModified event problem

2 REPLIES 2
Reply
Message 1 of 3
Amremad
351 Views, 2 Replies

ObjectModified event problem

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 ??

2 REPLIES 2
Message 2 of 3
Amremad
in reply to: Amremad

any help please ?
Message 3 of 3
Amremad
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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost