TheSwamp

Code Red => .NET => Topic started by: Peter Guappa on March 16, 2014, 04:22:20 PM

Title: entity type in C#
Post by: Peter Guappa on March 16, 2014, 04:22:20 PM
Hi all,

How can I get the entity type in C# (block - arc - line - ....) when hovering over an entity?
If it is a block, how can I get the block name?

Thx.
Title: Re: entity type in C#
Post by: Kerry on March 16, 2014, 04:25:34 PM

Have you read this ?
http://adndevblog.typepad.com/autocad/2014/02/detecting-entities-under-cursor-while-selection-is-running.html
Title: Re: entity type in C#
Post by: fixo on March 16, 2014, 04:27:24 PM
This article may helps too
http://through-the-interface.typepad.com/through_the_interface/2009/07/providing-information-on-autocad-objects-in-a-tooltip-using-net.html
Title: Re: entity type in C#
Post by: Kerry on March 16, 2014, 04:29:09 PM
Thanks Oleg,
I came back to add that one :)
Title: Re: entity type in C#
Post by: Peter Guappa on March 16, 2014, 04:32:11 PM
Thx guys!
Title: Re: entity type in C#
Post by: Peter Guappa on March 16, 2014, 05:12:24 PM
I'm stuck. My C# knowledge is almost nil.

I can get the entity type by using  "id.ObjectClass.Name"

But how can I get the block name?

     if (id.ObjectClass.Name == "AcDbBlockReference")
     { ......

Title: Re: entity type in C#
Post by: Peter Guappa on March 16, 2014, 05:43:05 PM
got it
Title: Re: entity type in C#
Post by: Andrey Bushman on March 17, 2014, 12:17:21 AM
Don't forget about the dynamic block instances.