This is a Document class Save the document to disk Save the document under a new name to disk Save a copy of the document under a new name to disk Load the document from the given path Restore the document from disk Checks if the document is saved Get the program version that a project file was created with For a regular document it returns its file name property. For a temporary document it returns its transient directory. Merges this document with another project file Export the dependencies of the objects as graph openTransaction(name) - Open a new Undo/Redo transaction. This function no long creates a new transaction, but calls FreeCAD.setActiveTransaction(name) instead, which will auto creates a transaction with the given name when any change happed in any opened document. If more than one document is changed, all newly created transactions will have the same internal ID and will be undo/redo together. Abort an Undo/Redo transaction (rollback) Commit an Undo/Redo transaction addObject(type, name=None, objProxy=None, viewProxy=None, attach=False, viewType=None) Add an object to document type (String): the type of the document object to create. name (String): the optional name of the new object. objProxy (Object): the Python binding object to attach to the new document object. viewProxy (Object): the Python binding object to attach the view provider of this object. attach (Boolean): if True, then bind the document object first before adding to the document to allow Python code to override view provider type. Once bound, and before adding to the document, it will try to call Python binding object's attach(obj) method. viewType (String): override the view provider type directly, only effective when attach is False. addProperty(type: string, name: string, group="", doc="", attr=0, read_only=False, hidden=False) -- Add a generic property. removeProperty(string) -- Remove a generic property. Note, you can only remove user-defined properties but not built-in ones. Remove an object from the document copyObject(object, with_dependencies=False, return_all=False) Copy an object or objects from another document to this document. object: can either a single object or sequence of objects with_dependencies: if True, all internal dependent objects are copied too. return_all: if True, return all copied objects, or else return only the copied object corresponding to the input objects. moveObject(object, bool with_dependencies = False) Transfers an object from another document to this document. object: can either a single object or sequence of objects with_dependencies: if True, all internal dependent objects are copied too. importLinks(object|[object...]) Import any externally linked object given a list of objects in this document. Any link type properties of the input objects will be automatically reassigned to the imported object If no object is given as input, it import all externally linked object of this document. Undo one transaction Redo a previously undone transaction Clear the undo stack of the document Clear the whole document Set a flag that allows or forbids to close a document Check if the document can be closed. The default value is True recompute(objs=None): Recompute the document and returns the amount of recomputed features Check if any object must be recomputed Purge the touched state of all objects Check if any object is in touched state Return the object with the given name Return the objects with the given label name. NOTE: It's possible that several objects have the same label name. findObjects([Type=string], [Name=string], [Label=string]) -> list Return a list of objects that match the specified type, name or label. Name and label support regular expressions. All parameters are optional. getLinksTo(obj, options=0, maxCount=0): return objects linked to 'obj' options: 1: recursive, 2: check link array. Options can combine. maxCount: to limit the number of links returned A list of supported types of objects Returns a file name with path in the temp directory of the document. getDependentDocuments(sort=True) Returns a list of documents that this document directly or indirectly links to including itself. sort: whether to topologically sort the return list The dependency graph as GraphViz text The last created object in this document The list of objects in this document The list of objects in this document in topological sorted order The list of root objects in this document The Undo mode of the Document (0 = no Undo, 1 = Undo/Redo) The size of the Undo stack in byte Number of possible Undos Number of possible Redos A list of Undo names A List of Redo names The internal name of the document Returns or sets if automatic recomputes for this document are disabled. Check if there is a pending transaction A list of all documents that link to this document. A list of all documents that this document links to. Indicate if the document is restoring Indicate if the document is partially loaded Indicate if the document is importing. Note the document will also report Restoring while importing Indicate if the document is recomputing Indicate whether the document is undoing/redoing Contains the old label before change Check if this is a temporary document