Rhino.LastObject is actually the first object added to the file (last item in the object table which is in chronological order). Rhino.FirstObject is actually the most recent object added to the document.
However if you want the last objects created by an operation, it is Rhino.LastCreatedObjects().
It was for the most part, yes. I am still having confusion with the difference between First and Last Object. I have used Last Object in my brief experience of Rhino Script as the most recent object I have created or modified and it has worked for me. However, it seems now that I should be using First Object in this case. I am confused on the difference and when to use each.
No, contrary to what you might believe, FirstObject is the most recently created object, because objects are treated as a ‘stack’, the most recent being ‘on top’.
LastObject is the oldest object in the file because it’s on the bottom of the ‘stack’
If you are creating objects via scripting Rhino.Command(), you should be using Rhino.LastCreatedObjects() just after running your Rhino.Command(), it will be an array of any objects that were created. If the result is null, then something went wrong with the command…
Oh, and it’s actually pretty rare to need to use either FirstObject or LastObject. In general if you are creating things with Rhinoscript methods, the newly created object ID’s are output by the method already.