varset_query
freecad.datamanager_wb.varsets.varset_query
¶
Query helpers for FreeCAD VarSets.
Provides functions to list varsets, list their variables, and find expression references to varset variables.
getVarsetReferences(varset_name, variable_name=None, *, ctx=None)
¶
Find expression engine entries that reference a VarSet or variable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
varset_name
|
str
|
VarSet name. |
required |
variable_name
|
str | None
|
Optional variable name to scope matches. When omitted,
all expressions containing |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Mapping of |
Source code in freecad/datamanager_wb/varsets/varset_query.py
getVarsetVariableGroups(varset_name, *, ctx=None)
¶
Return mapping of variable/property name -> group for a VarSet.
FreeCAD VarSet variables are stored as properties and may be organized into groups (property group). When no group is defined, FreeCAD uses "Base".
Source code in freecad/datamanager_wb/varsets/varset_query.py
getVarsetVariableNames(varset_name, *, ctx=None)
¶
Return variable/property names defined on a VarSet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
varset_name
|
str
|
Name of the |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted list of variable/property names. Built-in FreeCAD properties |
list[str]
|
(Label, Placement, etc.) are excluded. |
Source code in freecad/datamanager_wb/varsets/varset_query.py
getVarsetVariableNamesForGroup(varset_name, group_name, *, ctx=None)
¶
Return variable/property names defined on a VarSet, optionally filtered by group.
Source code in freecad/datamanager_wb/varsets/varset_query.py
getVarsets(*, exclude_copy_on_change=False, ctx=None)
¶
Yield VarSet object names from the active document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude_copy_on_change
|
bool
|
When true, filters out VarSets that are created by FreeCAD's copy-on-change mechanism. |
False
|
Yields:
| Type | Description |
|---|---|
str
|
The |