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

How to use GetObject() to identify an entity's type via this entity's ObjectId?

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
452 Views, 3 Replies

How to use GetObject() to identify an entity's type via this entity's ObjectId?

Hello,I don't fully understand what an objetctId is,and how to make good full use of an ObjectId.How to use the GetObject() method.For example,I create a polyline and add this polyline to an ObjectIdcollection.Now,how can I identify this polyline via the ObjectId?

3 REPLIES 3
Message 2 of 4
SRSDS
in reply to: Anonymous

Try this

 

Dim obj As DBObject = tr.GetObject(ObjId, OpenMode.ForRead)
Dim lwp As Polyline = TryCast(obj, Polyline)
If lwp IsNot Nothing Then
'...
End If

 

Message 3 of 4
StephenPreston
in reply to: SRSDS

Opening an object just to check its object type (to know if you should have opened it) is very time consuming if you're iterating over a large drawing. ObjectId exposes the ObjectClass property so you can check the RXClass of the DbObject the ObjectId is associated with.

 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 4 of 4
jeff
in reply to: Anonymous

Look at the arxdoc.chm in the docs folder in the ObjectARX SDK.

 

In the index tab type ObjectID and select about ObjectId structure. It will give you a good explanation.

 

When you create a polyline it's objectId is returned when you use BlockTableRecord.AppendEntity

 

 

 

You can also find your answers @ TheSwamp

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