.NET

Reply
Valued Contributor
cdinten
Posts: 61
Registered: ‎11-19-2010
Message 1 of 3 (140 Views)
Accepted Solution

Select an Entity Event?

140 Views, 2 Replies
04-16-2014 06:30 AM
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!
Valued Mentor
Ajilal.Vijayan
Posts: 425
Registered: ‎01-12-2008
Message 2 of 3 (129 Views)

Re: Select an Entity Event?

04-16-2014 07:21 AM 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));


            }

        }

 

Valued Contributor
cdinten
Posts: 61
Registered: ‎11-19-2010
Message 3 of 3 (98 Views)

Re: Select an Entity Event?

04-17-2014 12:23 AM in reply to: Ajilal.Vijayan
ok, thanks Ajilal, i will look into the Editor's evnets and i can solve it~

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community