Hi,
why not modifying your loop in that way:
declare previousObj
declare currentObj
foreach(ObjectId oid in blockTableRecord)
{
// if previousObj defined (so to step over if it's the first object in queue and continue with loop2/object2)
// {
// get currentObj
// check currentObj
// do something with previousObj
// save currentObj as previouObj for the next loop
// }
}
Another option might be to first scan through the BlockTableRecord and gather the ObjectIDs into a collection (or any type of list/array that can be accessed by an index).
- alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)