freecad_helpers
freecad.datamanager_wb.freecad_helpers
¶
Shared helper utilities for interacting with FreeCAD documents.
These helpers centralize small FreeCAD-facing operations (document access,
object lookup, expression iteration, copy-on-change filtering) behind a narrow
API. Most functions accept an optional FreeCadContext so they can be tested
outside FreeCAD.
build_expression_key(*, obj_name, lhs)
¶
Build the canonical expression key string for a named expression entry.
get_active_document(*, ctx=None)
¶
get_copy_on_change_groups(doc)
¶
Return all CopyOnChange groups found in the given document.
Source code in freecad/datamanager_wb/freecad_helpers.py
get_copy_on_change_names(*, doc, type_id)
¶
Return object names of the given type_id under CopyOnChange groups.
Source code in freecad/datamanager_wb/freecad_helpers.py
get_object_name(obj)
¶
Return the object's internal Name if present and non-empty.
get_typed_object(doc, name, *, type_id)
¶
Return a named document object only if its TypeId matches.
Source code in freecad/datamanager_wb/freecad_helpers.py
iter_document_objects(doc)
¶
Yield non-null objects from a FreeCAD document's Objects list.
iter_expression_engine_entries(doc)
¶
Yield (obj, lhs, expr_text) tuples for expression engine entries.
Source code in freecad/datamanager_wb/freecad_helpers.py
iter_named_expression_engine_entries(doc)
¶
Yield (obj_name, lhs, expr_text) tuples for expression engine entries.
Source code in freecad/datamanager_wb/freecad_helpers.py
iter_object_children(obj)
¶
Yield child objects by traversing common FreeCAD container attributes.