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?
Dim obj As DBObject = tr.GetObject(ObjId, OpenMode.ForRead) Dim lwp As Polyline = TryCast(obj, Polyline) If lwp IsNot Nothing Then '... End If
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.
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