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

get new id entity

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
joantopo
623 Views, 2 Replies

get new id entity

Hi.

 

I am doing a routine to break a polyline in different points.

 

I do this by prompt with SendCommand.

 

   string strHandle1 = id.Handle.ToString();
   string strEntName1 = "(handent \"" + strHandle1 + "\")";


  string strCommand = "_BREAK" + "\n" + strEntName1 + "\n" + String_point + "\n" + String_point + "\n";
  Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute(strCommand, true, false, true);

 

However, I need the new Id of polyline to continue break in other point.

 

I have tried this:

 ObjectId idNewEntity = Autodesk.AutoCAD.Internal.Utils.EntLast();

to get the last entity created, but with "break" doesn´t consider new  entity created.

 

 

Then, How can I get the new Id after "break"?

 

Thanks in advance.

 

 

 

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
2 REPLIES 2
Message 2 of 3
philippe.leefsma
in reply to: joantopo

Hi,

 

My initial though would be rather to use the API to achieve that task. The polyline entity should provide the methods and properties required to replicate the BREAK command.

 

But if you want to stick to that approach, did you consider using a "Database.ObjectAppended" handler to grab the id's of newly created entities?

 

I hope it helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
joantopo
in reply to: philippe.leefsma

I will use "GetSplitCurves()" that returns DBObjectCollection instead "break" command.

 

Thanks.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes

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