How can I get the object id of the just created entity.
acTrans.AddNewlyCreatedDBObject(acPoint, true); acTrans.Commit();
Selected the point on the dwg with PromptPointResult result value and added it.
Then I want the objectid of this acPoint, to do my next operation.
Solved! Go to Solution.
Solved! by Alexander.Rivilis. See the answer in context.
If acPoint is database resident object, then acPoint.ObjectId return ObjectId of this object/entity
If you appened this DBPoint to some BlockTableRecord before adding it to the Transaction, the BlocktTableRecord.Appendentity() method returns the ObjectId of the entity.
I'm afraid you're confusing DatabaseServices.DBPoint which is a graphic entity with Geometry.Point3d which is an abstract geometrical object.
The first one has an ObjectId affected as soon as it's added to a Databse, IOW appended to a BlockTableRecord (space or block definition)
The second one is the tye returned by PromptPointResult.Value and will never be databse resident nor have an ObjectId. It's only to be used for geometric purposes.
Access a broad range of knowledge to help get the most out of your products and services.