.NET

Reply
Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 1 of 5 (313 Views)
Accepted Solution

get object Id of the newly created entity.

313 Views, 4 Replies
12-05-2012 03:27 AM

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.

 

Please suggest.

*Expert Elite*
_gile
Posts: 2,077
Registered: ‎04-29-2006
Message 2 of 5 (304 Views)

Re : get object Id of the newly created entity.

12-05-2012 05:12 AM in reply to: newautocad123

Hi,

 

If you appened this DBPoint to some BlockTableRecord before adding it to the Transaction, the BlocktTableRecord.Appendentity() method returns the ObjectId of the entity.

Gilles Chanteau
Moderator
Alexander.Rivilis
Posts: 1,398
Registered: ‎04-09-2008
Message 3 of 5 (296 Views)

Re: get object Id of the newly created entity.

12-05-2012 06:08 AM in reply to: newautocad123

If acPoint is database resident object, then acPoint.ObjectId return ObjectId of this object/entity


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

*Expert Elite*
_gile
Posts: 2,077
Registered: ‎04-29-2006
Message 4 of 5 (286 Views)

Re : get object Id of the newly created entity.

12-05-2012 06:53 AM in reply to: newautocad123

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.

Gilles Chanteau
Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 5 of 5 (255 Views)

Re : get object Id of the newly created entity.

12-05-2012 09:35 PM in reply to: _gile

Thanks All.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community