import FreeCADGui doc = FreeCADGui.getDocument()
import FreeCADGui doc = FreeCADGui.getDocument("Untitled")This example code retrieves the document named "Untitled" in FreeCAD using the getDocument function and assigns it to the variable 'doc'. Package library: FreeCAD.