Skip to content

Instantly share code, notes, and snippets.

@hanswillem
Last active August 29, 2015 14:07
Show Gist options
  • Save hanswillem/e019062b6304e4beb66e to your computer and use it in GitHub Desktop.
Save hanswillem/e019062b6304e4beb66e to your computer and use it in GitHub Desktop.
Function that returns all objects in the hierarchy
#GetAllObjects
def getAllObjects():
allObjs = []
def itterate(obj):
while obj:
allObjs.append(obj)
itterate(obj.GetDown())
obj = obj.GetNext()
return allObjs
obj = doc.GetFirstObject()
itterate(obj)
return allObjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment