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

How do you get the Entity Name?

393 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
Posts: 38
Registered: ‎09-08-2006
Message 2 of 3 (393 Views)

Re: How do you get the Entity Name?

10-17-2006 01:44 PM in reply to: stuartshaw
Active Contributor
Posts: 38
Registered: ‎08-31-2006
Message 3 of 3 (393 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"
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.