Std VarSet
Appearance
|
|
| Menu location |
|---|
| None |
| Workbenches |
| All |
| Default shortcut |
| None |
| Introduced in version |
| 1.0 |
| See also |
| Spreadsheet Workbench, DynamicData Workbench |
Description
The Std VarSet command creates a VarSet. A VarSet is a set of properties that can be used as variables in expressions.
The Add Property dialog box
Usage
- Do one of the following:
- To create a new VarSet: press the
Variable Set button.
- To edit an existing VarSet: double-click the set in the Tree View.
- To create a new VarSet: press the
- The Add Property dialog box opens.
- Enter a Name for the property.
- The name must be unique for the VarSet.
- Only alphanumeric characters and underscores (
AtoZ,atoz,0to9and_) are allowed. - The first character may not be a digit.
- FreeCAD uses the UpperCamelCase convention for its property names, meaning each word starts with a capital letter, and there are no spaces or underscores. When the Property View displays such a name, spaces are inserted between the words, making the name easier to read. It is advisable to follow this convention.
- Enter a Group name for the property or select a group from the list. Group names have the same restrictions as property names.
- Select the property Type from the list. See below for the most common types.
- Enter a Value for the property. This input accepts units for properties that have units. You can also specify an expression.
- 1.0 and below: Optionally check the Add another checkbox if you want to add more properties.
- Optionally enter a Tooltip for the property.
- Press the OK button.
- The dialog box reopens (1.0 and below: only if the Add another checkbox has been checked) and a new property can be added.
- Press the Cancel button when done.
Common property types
FreeCAD supports many property types. The table below lists some of the most common types. See FeaturePython Custom Properties for more information.
| Property type | Default unit (if any) | Remark |
|---|---|---|
App::PropertyAngle |
° (or deg) | |
App::PropertyBool |
true or false, can be used in conditional expressions
| |
App::PropertyDistance |
mm | |
App::PropertyFloat |
Decimal number | |
App::PropertyInteger |
Whole number | |
App::PropertyLength |
mm | Similar to App::PropertyDistance but cannot be negative
|
App::PropertyString |
Text string |
Notes
- Properties can also be added to existing VarSets in the Expression editor by checking the Store in Variable Set… checkbox.
- A property can be removed from a VarSet via the context menu of the Property View.
- A group name can be changed via the same menu.
- 1.0 and below: The command cannot set the list of allowed items of an
App::PropertyEnumerationproperty. This can be done via Python code or in the Property View. The steps for the latter option are:- Select Show hidden in the context menu of the Property View.
- Expand the node of the property.
- Click in the Enum field.
- Press the … button that appears.
- Enter values in the List dialog box that opens.
- Press the OK button.
- VarSets can also be edited with the commands from the DynamicData Workbench. Properties can be renamed, regrouped, retyped, and their tooltip updated. This external workbench can be installed from the Addon Manager.
Scripting
import FreeCAD as App
doc = App.ActiveDocument
var_set = doc.addObject("App::VarSet", "VarSetName")
var_set.addProperty("App::PropertyInteger", "MyNumber") # Property is added to the Base group.
var_set.MyNumber = 123
var_set.addProperty("App::PropertyString", "MyText", group="SomeGroup", doc="Some tooltip information")
var_set.MyText = "Abc"
doc.recompute()
- File: New Document, Open, Open Recent, Close, Close All, Save, Save As, Save Copy, Save All, Revert, Import, Export,Merge Document, Document Information, Print, Print Preview, Export PDF, Exit
- Edit: Undo, Redo, Cut, Copy, Paste, Duplicate Object, Recompute, Box Selection, Box Element Selection, Select All, Delete, Send to Python Console, Placement, Transform, Align To, Toggle Edit Mode, Properties, Edit Mode, Preferences
- View:
- Miscellaneous: New 3D View, Orthographic View, Perspective View, Fullscreen, Bounding Box, Toggle Axis Cross, Clipping View, Texture Mapping, Toggle Navigation/Edit Mode, Material, Appearance, Random Color, Appearance per Face, Toggle Transparency, Workbench, Status Bar
- Standard Views: Fit All, Fit Selection, Align to Selection, Isometric, Dimetric, Trimetric, Home, Front, Top, Right, Rear, Bottom, Left, Rotate Left, Rotate Right, Store Working View, Recall Working View
- Freeze Display: Save Views, Load Views, Freeze View, Clear Views
- Draw Style: As Is, Points, Wireframe, Hidden Line, No Shading, Shaded, Flat Lines
- Stereo: Stereo Red/Cyan, Stereo Quad Buffer, Stereo Interleaved Rows, Stereo Interleaved Columns, Stereo Off, Issue Camera Position
- Zoom: Zoom In, Zoom Out, Box Zoom
- Document Window: Docked, Undocked, Fullscreen
- Visibility: Toggle Visibility, Show Selection, Hide Selection, Select Visible Objects, Toggle All Objects, Show All Objects, Hide All Objects, Toggle Selectability
- Toolbars: File, Edit, Clipboard, Workbench, Macro, View, Individual Views, Structure, Help, Lock Toolbars
- Panels: Tree View, Property View, Model, Selection View, Python Console, Report View, Tasks, DAG View
- Overlay Docked Panel: Toggle Overlay for All Panels, Toggle Transparent Panels, Toggle Overlay, Toggle Transparent Mode, Bypass Mouse Events in Overlay Panels, Toggle Left, Toggle Right, Toggle Top, Toggle Bottom
- Link Navigation: Go to Linked Object, Go to Deepest Linked Object, Select All Links
- Tree View Actions: Sync View, Sync Selection, Sync Placement, Preselection, Record Selection, Single Document, Multi Document, Collapse/Expand, Initiate Dragging, Go to Selection, Selection Back, Selection Forward
- Tools: Addon Manager, Measure, Clarify Selection, Quick Measure, Units Converter, Load Image, Save Image, Text Document, View Turntable, Scene Inspector, Dependency Graph, Export Dependency Graph, Document Utility, Edit Parameters, Customize
- Macro: Record Macro, Macros, Recent Macros, Execute Macro, Attach to Remote Debugger, Debug Macro, Stop Debugging, Step Over, Step Into, Toggle Breakpoint
- Help: What's This, Start Page, Users Documentation, FreeCAD Forum, Report an Issue, Restart in Safe Mode, Developers Handbook, Python Modules Documentation, FreeCAD Website, Donate to FreeCAD, About FreeCAD
- Additional:
- Miscellaneous: New Part, New Group, Variable Set, Link Group, Select All Instances, Toggle Freeze
- Datums: Coordinate System, Datum Plane, Datum Line, Datum Point
- Link Actions: Make Link, Make Sub-Link, Replace With Link, Unlink, Import Link, Import All Links
- Expression Actions: Copy Selected, Copy Active Document, Copy All Documents, Paste
- Selection Filter: Vertex Selection, Edge Selection, Face Selection, No Selection Filters
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub
