Weird GetObjectList() return & what is an 'ActiveObject'


Given the following code:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
	var settings = new ObjectEnumeratorSettings();
	settings.ActiveObjects = true;
	settings.NormalObjects = true;
	settings.HiddenObjects = true;
	settings.LockedObjects = true;
	settings.ObjectTypeFilter = ObjectType.AnyObject;

	var objects = doc.Objects.GetObjectList(settings);			

	foreach (var obj in objects)
	return Result.Success;

Strangely, doc.Objects.GetObjectList(settings) returns some items, but they are like empty objects in the debug inspection tab:

Is that normal?

Moreover, the property ObjectEnumeratorSettings.ActiveObjects is not really clear to me: what are exactly ‘ActiveObjects’? Selected objects? What would be the opposite of ‘ActiveObjects’?

The doc is not really helpful:

Here’s the version I’m running:

Rhino 6 SR30 2020-8-26 (Rhino 6, 6.30.20239.17111, Git hash:master @ 6b3c909b3d6e766c249ca21fcd00b31ad5432d0c)
License type: Commercial, build 2020-08-26
License details: LAN Zoo Network Node

Thanks in advance for your hints!

What would be the opposite of ‘ActiveObjects’?

import Rhino
from scriptcontext import doc
import System.Guid

def FindReferenceObjects():
    settings = Rhino.DocObjects.ObjectEnumeratorSettings()
    settings.ActiveObjects = False
    settings.ReferenceObjects = True
    ids = [rhobj.Id for rhobj in doc.Objects.GetObjectList(settings)]
    if not ids:
        print "No reference object"
        return Rhino.Commands.Result.Failure
        print "Found", len(ids), "reference objects"
        for id in ids: print "  ", id
    return Rhino.Commands.Result.Success

if __name__ == "__main__":
    FindReferenceObjects() (603 Bytes)

1 Like

Thanks @Mahdiyar,

makes sense now!