Getobjectlist from worksession files

Hello,
i can get all object list in the document with the below code(vb).
dim all=doc.objects.getobjectlist(objecttype.anyobject)
but i also need to get the objects in the other worksession files. How can i do that?

Thanks

Hi Serdem,

Does this help?

Imports Rhino
Imports Rhino.Commands
Imports Rhino.DocObjects

...

Protected Overrides Function RunCommand(ByVal doc As RhinoDoc, ByVal mode As RunMode) As Result

  Dim filter = New ObjectEnumeratorSettings()
  filter.NormalObjects = True
  filter.LockedObjects = True
  filter.ActiveObjects = True
  filter.ReferenceObjects = True

  Dim rhObjects = doc.Objects.FindByFilter(filter)
  If rhObjects IsNot Nothing Then
    For Each rhObj As RhinoObject In rhObjects
      If Not rhObj.IsDeleted Then
        Dim str = If((rhObj.IsReference), "worksession", "model")
        Dim desc = rhObj.ShortDescription(False)
        RhinoApp.WriteLine("{0} {{{1}}} is a {2} object", desc, rhObj.Id, str)
      End If
    Next
  End If

  Return Result.Success

End Function

Hi Dale,

it didnt work, i dont know why

best regards

Well, it certainly work here. I’ll need more information and probably your worksession and models to be of any more help.