.NET

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

get object Id of the newly created entity.

287 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*
Posts: 1,982
Registered: ‎04-29-2006
Message 2 of 5 (278 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,346
Registered: ‎04-09-2008
Message 3 of 5 (270 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*
Posts: 1,982
Registered: ‎04-29-2006
Message 4 of 5 (260 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
Posts: 58
Registered: ‎09-03-2012
Message 5 of 5 (229 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
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

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

Ask the Community