Skip to content

Document Nodes

infeeeee edited this page Nov 4, 2020 · 5 revisions

Table of Contents generated with DocToc

Document nodes

Create Create

Create or open FreeCAD documents

NewDocument

Start with this or with OpenDocument. This loads the FreeCAD library to Dynamo, so nothing will work without one of these nodes.

To the FreeCADbinPath node connect the path of the bin directory of your FreeCAD installation. You have to find FreeCAD.pyd in this folder.

name port is optional, if it's not given the new document will be named Unnamed. You can change the name later with Object.SePropertyByName.

OpenDocument

Start with this or with NewDocument. This loads the FreeCAD library to Dynamo, so nothing will work without one of these nodes.

To the FreeCADbinPath node connect the path of the bin directory of your FreeCAD installation. You have to find FreeCAD.pyd in this folder.

Action Action

CloseAllDocuments

Only runs if you connect a boolean true to the run connector. By default it's false, and won't run even in automatic mode. It closes all documents without saving, use it carefully!

CloseDocument

Connect a document to close it.

Recompute

Recompute document, F5 in FreeCAD

SaveAs

Saves the document to a path. You can use the path from Document.FileName to save the file to the same location. Be careful, this node overwrites without a question!

SetActiveDocument

Use this node with ListDocuments as in the example and in the screenshots.

Only use this node if you are working with multiple documents. Otherways use the output of the OpenDocument and CloseDocument nodes.

Query Query

ActiveDocument

Connect a Boolean node to update this node in automatic mode. It will update even if changed to true or false.

Only use this node if you are working with multiple documents. Otherways use the output of the OpenDocument and CloseDocument nodes.

FileName

Returns the full path of a FreeCAD document. Same as the FileName property in FreeCAD.

FindAllObjects

Lists all objects from a FreeCAD document. Uses Document.findObjects() under the hood.

GetObjectByName

Get an object by name. Remember, name, not label! Name is not visible by default on the FreeCAD gui. Name is a unique identifier of an object.

ListAllObjects

List all objects, their names and their labels in a document, without hierarchy.

ListDocuments

The output is a dictionary, where the key is the name and the value is the document

Connect a Boolean node to update this node in automatic mode. It will update even if changed to true or false.

Only use this node if you are working with multiple documents. Otherways use the output of the OpenDocument and CloseDocument nodes.

Name

Returns the name of a Document. It's actually the same node as Object.Name.