how to find last created object in AutoCAD using COM in C#

how to find last created object in AutoCAD using COM in C#

VallimanalanT
Enthusiast Enthusiast
1,606 Views
2 Replies
Message 1 of 3

how to find last created object in AutoCAD using COM in C#

VallimanalanT
Enthusiast
Enthusiast

Hi,

Any one help, how to find last created object in AutoCAD using COM in C#

0 Likes
Accepted solutions (1)
1,607 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

 

You can get the last entity in model space using ModelSpace.Item(ModelSpace.Count - 1)

dynamic acdoc = doc.GetAcadDocument();
var modelSpace = acdoc.ModelSpace;
var lastent = modelSpace.Item(modelSpace.Count - 1);


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 3

VallimanalanT
Enthusiast
Enthusiast

Thank you

0 Likes