.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you get the Entity Name?

2 REPLIES 2
Reply
Message 1 of 3
stuartshaw
1450 Views, 2 Replies

How do you get the Entity Name?

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.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: stuartshaw

Autodesk.autocad.windows.linetypedialog.linetype.handle
Message 3 of 3
ahmed.felix
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"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost