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.
Go to Solution.
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,
I will use "GetSplitCurves()" that returns DBObjectCollection instead "break" command.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.