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

get object Id of the newly created entity.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
newautocad123
2651 Views, 4 Replies

get object Id of the newly created entity.

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.

4 REPLIES 4
Message 2 of 5
_gile
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
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 5

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

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 4 of 5
_gile
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
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 5
newautocad123
in reply to: _gile

Thanks All.

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