Author Topic: entity type in C#  (Read 1838 times)

0 Members and 1 Guest are viewing this topic.

Peter Guappa

  • Guest
entity type in C#
« 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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: entity type in C#
« Reply #3 on: March 16, 2014, 04:29:09 PM »
Thanks Oleg,
I came back to add that one :)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter Guappa

  • Guest
Re: entity type in C#
« Reply #4 on: March 16, 2014, 04:32:11 PM »
Thx guys!

Peter Guappa

  • Guest
Re: entity type in C#
« Reply #5 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")
     { ......


Peter Guappa

  • Guest
Re: entity type in C#
« Reply #6 on: March 16, 2014, 05:43:05 PM »
got it

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: entity type in C#
« Reply #7 on: March 17, 2014, 12:17:21 AM »
Don't forget about the dynamic block instances.