Get entity type

Get entity type

Anonymous
Not applicable
3,324 Views
3 Replies
Message 1 of 4

Get entity type

Anonymous
Not applicable

Hi,

I filtering for objects based on layer as shown below.How do i know which type the entity is like whether it is arc or line or circle.Any ideas please.

 

Dim ss As SelectionSet

Dim idarray As ObjectId() = ss.GetObjectIds()

 

Dim id AsObjectId

For Each id In idarray

    Dim entity As = trLocal.GetObject(id, OpenMode.ForRead, True)

Next id

0 Likes
Accepted solutions (1)
3,325 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
entity.GetType() will help you.

Regards
Zakir
Message 3 of 4

augusto.goncalves
Alumni
Alumni
Accepted solution

You can probably try:

 

For Each id In idarray
    Dim ent As Entity = trLocal.GetObject(id, OpenMode.ForRead, True)

    if (typeof ent is Arc) then

   

    else if (typeof ent is Line) then

 

    end if
Next id

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 4 of 4

Anonymous
Not applicable
Thanks a lot for the replies 🙂
0 Likes