@CMWADE .. why even have this function?
IMO the programmer should be responsible for passing the correct data type initially rather than creating a sub that checks on each iteration. Inefficient.
In a perfect world that would be ideal; however, this is part of a much, much more complex routine that actually keeps track of the last object it drew, even after closing and reopening the drawing. Part of the issue becomes handling this if someone erased the last object drawn.
Additionally, this is part of an extremely complex routine that all totaled is about 1,100 lines of code, some of which are supporting functions done by others and some of those routines return ENAME and some return VLA-OBJECT, now I could sit here and code each one to convert ENAME to VLA-OBJECT when necessary or I can use a simple function to figure it out automatically.
And yes, I could go and rework the whole thing, but I have 70+ AutoCAD users to support and this issue was causing some major headaches, so I had to take the quickest path to the solution, even if it isn't the most efficient, in terms of this routine it causes 2-3milliseconds in delay at most, I am all for speed, but there has to be a balance, especially when writing the routines is not the only part of my job.