.NET

Reply
Active Member
stuartshaw
Posts: 8
Registered: ‎10-29-2003
Message 1 of 3 (377 Views)

How do you get the Entity Name?

377 Views, 2 Replies
09-18-2006 03:51 PM
Does anyone know how to get the entity name (code -01) from an entity. I am using vb.net 2005 with AuotCAD 2007.

I also am using AutoCAD Intent that returns the entity name but I need to get to the handle or ObjectId.
Active Contributor
Littlerubarbwk
Posts: 38
Registered: ‎09-08-2006
Message 2 of 3 (377 Views)

Re: How do you get the Entity Name?

10-17-2006 01:44 PM in reply to: stuartshaw
Autodesk.autocad.windows.linetypedialog.linetype.handle
Active Contributor
ahmed.felix
Posts: 38
Registered: ‎08-31-2006
Message 3 of 3 (377 Views)

Re: How do you get the Entity Name?

10-30-2006 09:18 AM in reply to: stuartshaw
For comparison purposes you could simply use TypeOf.

If TypeOf entEntity Is Line Then
' Some code
End If

Note that Autodesk.AutoCAD.DatabaseServices must be imported
to use the Line type directly.

If you want the name of the entity without comparison then you could do this:

Dim strName as String
strName = entEntity.GetType.ToString

That will return something like "Autodesk.AutoCad.DatabaseServices.Line"

Dim strTypes() As String
strTypes= entEntity.GetType.ToString.Split(".")
strName = strTypes(strTypes.GetUpperBound(0))

That will return just "Line"
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 or visit the Installation and Licensing Forum to get help installing your software.