.NET

Reply
Active Contributor
gulzar25
Posts: 42
Registered: ‎07-02-2013
Message 1 of 4 (329 Views)
Accepted Solution

Get entity type

329 Views, 3 Replies
07-11-2013 06:30 AM

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

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

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 4 (322 Views)

Re: Get entity type

07-11-2013 07:18 AM in reply to: gulzar25
entity.GetType() will help you.

Regards
Zakir
ADN Support Specialist
augusto.goncalves
Posts: 387
Registered: ‎04-30-2009
Message 3 of 4 (309 Views)

Re: Get entity type

07-11-2013 10:01 AM in reply to: gulzar25

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
Autodesk Developer Network
Active Contributor
gulzar25
Posts: 42
Registered: ‎07-02-2013
Message 4 of 4 (272 Views)

Re: Get entity type

07-11-2013 08:00 PM in reply to: augusto.goncalves
Thanks a lot for the replies :smileyhappy:
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!