I try to figure how to look for a specific sketch in my document. App.ActiveDocument.findObjects() looks to be what I want.
the function's signature is findObjects([string(type)], [string (name)]) -> list
However, I don't understand how to fill the type's string. In the following example, I try to get a sketch called "hull":
Code: Select all
>>> App.ActiveDocument.findObjects('Sketcher.SketchObject', 'hull')
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.FreeCADError: 'Sketcher.SketchObject' is not a valid type
>>> # next try:
>>> App.ActiveDocument.findObjects('SketchObject', 'hull')
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.FreeCADError: 'SketchObject' is not a valid type