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

Select an Entity Event?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
cdinten
766 Views, 2 Replies

Select an Entity Event?

when i open a dwg file, and the i can use mouse to click one graphical object, like a line, a circle, an arc and so forth. so my question is, what event is raised when i just click an object, and how can i moniter it? Can anyone post some code for me? That would be of great helpful, thanks!
2 REPLIES 2
Message 2 of 3
Ajilal.Vijayan
in reply to: cdinten

Like this ?

The below code I copied from here

Preventing AutoCAD objects from being selected

 

 void OnSelectionAdded(object sender, SelectionAddedEventArgs e)
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;

            ObjectId[] addedIds = e.AddedObjects.GetObjectIds();

            for (int i = 0; i < addedIds.Length; i++)
            {

                ObjectId oid = addedIds[i];

                ed.WriteMessage("Selected Item : " +(oid.ObjectClass.DxfName));


            }

        }

 

Message 3 of 3
cdinten
in reply to: Ajilal.Vijayan

ok, thanks Ajilal, i will look into the Editor's evnets and i can solve it~

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