Assign Custom Properties to FreeCAD Arch Elements
This guide provides a straightforward walkthrough on assigning custom properties and metadata to architectural elements in FreeCAD. By leveraging built-in Property View tools, the BIM Workbench’s IFC property manager, and the Python console, you can easily attach project-specific parameters, cost codes, and operational data to any wall, slab, or architectural component for enriched Building Information Modeling (BIM) workflows.
Method 1: Using the Property View GUI
FreeCAD allows you to add dynamic properties directly through the graphical user interface.
- Select the architectural object (such as an Arch Wall, Structure, or Window) in the Tree View.
- Locate the Property View panel, typically positioned in the lower-left area of the workspace.
- Right-click anywhere in the empty space inside the Property View panel.
- Select Add property from the context menu.
- In the dialog box that appears:
- Type: Choose the data type you need (for example,
App::PropertyStringfor text,App::PropertyFloatfor decimal numbers, orApp::PropertyLengthfor dimensions). - Group: Enter a group name to categorize the
property (e.g.,
CustomDataorCosting). - Name: Enter an internal identifier with no spaces
(e.g.,
ManufacturerorFireRating).
- Type: Choose the data type you need (for example,
- Click OK. The new property will appear under your specified group header. Select it to input your desired value.
Method 2: Assigning IFC Custom Property Sets (Psets)
When working with BIM projects requiring open standard exports (IFC), assigning custom Property Sets ensures that metadata transfers correctly to other software.
- Switch to the BIM Workbench via the workbench dropdown menu.
- Select the architectural element in the 3D view or Tree View.
- Navigate to the top menu and select Manage > Manage IFC Properties (or use the IFC properties button on the BIM toolbar).
- In the dialog, select an existing standard property set or click Add custom property set.
- Define the custom set name (for example,
Pset_CustomBuildingData). - Click Add property within that set, define its name and data type, and enter the corresponding value.
- Click OK to commit. The custom property set is bound to the element and will be included during IFC export.
Method 3: Using the Python Console
For automation or batch operations, you can assign custom properties via the integrated Python console.
- Ensure the Python console is visible (View > Panels > Python console).
- Run the following code snippet, replacing
"Wall"with your object's label:
# Reference the architectural object
obj = App.ActiveDocument.getObject("Wall")
# Add the custom property: (Type, Name, Group, Documentation)
obj.addProperty("App::PropertyString", "FireRating", "CustomSpecs", "Fire resistance duration in hours")
# Assign a value to the new property
obj.FireRating = "2 Hours"
# Recompute the document to apply changes
App.ActiveDocument.recompute()Once executed, the new attribute is permanently attached to the object and visible in the Property View.