larr; AlvaroGil.com nbsp;middot;nbsp; CAD/CAM
FeatureNamer Manual
FreeCAD addon · Sketcher + PartDesign

FeatureNamer

Name a feature in the dialog where you create or edit it. Features built from a named feature, and their type postfixes, are named for you.

Requires FreeCAD 1.1+ Developed on FreeCAD 27.1.0dev (weekly 2026.11.04) Version 0.2.0 · working prototype

Why

The tree of a real PartDesign body soon turns into Sketch007, Pad004, Pocket012. A feature is easiest to name right after you create it, while you still know what it is for. But FreeCAD's task dialogs have nowhere to type a name. You have to go back to the tree, find the item, rename it, and then return to your work.

Other CAD tools, Alibre Design for example, put a name field at the top of every feature dialog. FeatureNamer adds the same thing to FreeCAD. It can also ask for a name when a feature still has its default one.

Install

FeatureNamer is a plain Python addon in FreeCAD's modern addon layout, with a package.xml manifest. You don't need to compile anything. It works in every workbench and doesn't add a workbench of its own.

With the Addon Manager (recommended)

FeatureNamer isn't in the official addon list yet, so add it once as a custom repository:

  1. Open Edit ▸ Preferences ▸ Addon Manager ▸ Custom repositories and add https://github.com/avongil/FreeCAD-FeatureNamer with branch main.
  2. Open Tools ▸ Addon Manager, find FeatureNamer and click Install.
  3. Restart FreeCAD. The Addon Manager also tells you when there's an update.

By hand

  1. Download the repository from github.com/avongil/FreeCAD-FeatureNamer (Code ▸ Download ZIP) and unzip it.
  2. Rename the unzipped folder from FreeCAD-FeatureNamer-main to FeatureNamer and move it into the Mod folder of your FreeCAD user folder.
  3. Restart FreeCAD. To remove the addon, delete the folder.

After copying, your FreeCAD user folder looks like this:

<your FreeCAD user folder>/
└── Mod/
    └── FeatureNamer/                  # the unzipped folder, renamed
        ├── package.xml                # addon manifest
        └── freecad/
            └── FeatureNamer/
                ├── init_gui.py        # GUI entry point
                ├── core/naming.py     # pure naming rules (unit-tested)
                ├── features.py        # reads Profile / Base / Originals
                ├── preferences.py     # settings in the parameter store
                ├── commands.py        # Tools menu command
                ├── gui/               # observer, Name field, popup, preference page
                └── resources/icons/

Where is my FreeCAD user folder? In FreeCAD, open View ▸ Panels ▸ Python console and type App.getUserAppDataDir(). It prints the path. On Windows it is usually %APPDATA%\FreeCAD\vXX-Y, on Linux ~/.local/share/FreeCAD/vXX-Y, and on macOS ~/Library/Application Support/FreeCAD/vXX-Y. If there is no Mod folder yet, create it.

How to use it

Creating a feature

Create a Sketch, Pad, Pocket, Fillet, Hole or any other PartDesign feature as usual. If the feature still has its default name when the edit dialog opens, a small dialog asks for one. The current name is already selected, so you can just start typing.

Type a name and press Enter. Press Esc or click Skip to keep the default. Each feature is asked once per session.

The name field

While a Sketch or PartDesign feature is in edit mode, a Name field sits at the top of the Tasks panel, above the feature's own settings.

The field is added at the top of the existing panel. The feature's own task boxes stay the same.

Automatic names

Most features are built from another feature. When that feature already has a name, FeatureNamer names the new one for you and doesn't show the popup.

The base name carries forward and only the postfix changes. A Pocket started from a face of Lid_PAD becomes Lid_PKT.

To change postfixes, open Edit ▸ Preferences ▸ FeatureNamer. Its Automatic names section has a table of feature types and their postfixes, where you can edit, add or remove rows, or reset everything to the defaults.

FeaturePostfixFeaturePostfix
Sketch_SKTFillet_FIL
Pad_PADChamfer_CHF
Pocket_PKTDraft_DFT
Revolution_REVThickness_SHL
Groove_GRVMirrored_MIR
Hole_HOLELinear pattern_LPAT
Additive / subtractive pipe (Sweep)_SWP / _SSWPPolar pattern_PPAT
Additive / subtractive loft_LOFT / _SLOFTMultiTransform_MTR
Additive / subtractive helix_HLX / _SHLXBoolean_BOOL
Datum plane / line / point_PLN / _AXS / _PNTShape binder_BND

Settings

All options are on one page: Edit ▸ Preferences ▸ FeatureNamer. Tools ▸ FeatureNamer settings…, the entry with the green tag icon right below Edit Parameters, opens the same page, even while you're sketching. It has three groups: Naming features, Automatic names (with the postfix table) and Ignore these feature types. The settings are saved under BaseApp/Preferences/Mod/FeatureNamer.

The FeatureNamer page in FreeCAD's Preferences dialog, next to a model tree with features named HEX_SKT, HEX_PAD, HEX_Bottom_CHF and HEX_Top_SHL
The FeatureNamer page in Edit ▸ Preferences. On the left is the tree it produces: the Pad built from HEX_SKT was named HEX_PAD automatically, and the dress-up features carry _CHF and _SHL.
ParameterDefaultEffect
ShowNameFieldonShow the Name field at the top of the Tasks panel.
PromptIfUnnamedonShow the popup when editing starts on a feature with a default name.
NameFromBaseonName a feature after the feature it is built from, such as Moat_SKT → Moat_PAD, without asking.
AutoPostfixonAdd the type postfix to names you type.
Postfixessee tableOne TypeId=postfix pair per line. Edit them on the preference page.
FocusNameFieldoffPut the cursor in the Name field instead of showing a popup. This is the less intrusive option. It only applies while PromptIfUnnamed is off.
AskOnCloseoffAfter OK, ask again if the name is still the default, even if you skipped the first popup. This rename gets its own undo step.
ExcludeTypesPartDesign::BodyComma-separated list of TypeIds to ignore, for example PartDesign::Plane.

How it works

The addon uses only public FreeCAD Python APIs and reads one internal Qt class name. It doesn't patch any FreeCAD code.

startup
freecad/FeatureNamer/init_gui.py waits until the main window exists, then registers a Gui document observer, a programmatic preference page, one FeatureNamer_Settings command (CmdType: ForEdit, with its own SVG icon), and a workbench manipulator that adds the command to the Tools menu after Std_DlgParameter. Qt comes through FreeCAD's PySide shim.
slotInEdit(vp)
Runs whenever a view provider enters edit mode. If vp.Object.TypeId starts with Sketcher:: or PartDesign:: and isn't excluded, that object becomes the current target. The rest of the work is deferred with QTimer.singleShot(0) so setEdit() can finish building its task dialog first.
inject
Finds the visible Gui::TaskView::TaskPanel widget and inserts a NameBox frame at index 0 of its QBoxLayout, above the dialog's first task box.
derive
If the label is still the default, it finds the feature's source through Profile, Base (dress-up features only) or Originals. If the source has a real name, it removes the source's postfix and adds the new feature's postfix, so OutsideMoat_SKT becomes OutsideMoat_PAD. If the feature has no source yet, the watchdog keeps checking until one is picked.
prompt
If the label is still the default and the object hasn't been asked about yet, it shows a modal NameDialog and sets obj.Label. This happens inside the edit transaction.
watchdog
A 400 ms timer runs only while editing. It adds the field back if the dialog rebuilds its panel, and cleans up if the edit ends without a reset signal.
slotResetEdit(vp)
Removes the field and stops the timer. The watchdog runs the same step if it sees the edit end first, so the close is never missed. If AskOnClose is on, it checks doc.getObject(name) is obj to see whether the feature survived (Cancel deletes new features) and asks again inside its own transaction.

Detecting a default name

A label counts as default if it equals the internal Name, or if it is the name's alphabetic part followed only by digits. So a new Pad003 labelled Pad003, or Pad after a copy, counts as unnamed. Pad base plate doesn't.

# core/naming.py: no FreeCAD imports, covered by tests/test_naming.py
def is_default_label(label, name):
    if label == name:
        return True
    base = kind_from_name(name)                 # "Pad003" -> "Pad"
    return bool(base) and re.fullmatch(re.escape(base) + r"\d*", label) is not None

Finding the task panel

for w in Gui.getMainWindow().findChildren(QtWidgets.QWidget):
    if w.metaObject().className() == "Gui::TaskView::TaskPanel" and w.isVisible():
        w.layout().insertWidget(0, NameBox(obj, w))

Because the field writes to Label on every textEdited signal, the rename joins whatever transaction the task dialog has open. That is why Cancel and Undo treat it as part of the feature.

Known limits

Relies on an internal class name

The field depends on Gui::TaskView::TaskPanel having a box layout. If the task view is restructured, the field won't appear, but nothing else breaks.

Only covers features opened in edit mode

The addon only sees objects that enter edit mode through setEdit(). Dialogs that aren't tied to an object being edited, such as Part ▸ Extrude, aren't covered.

Keyboard focus

While the Name field has focus, single-key Sketcher shortcuts type into it. Enter hands focus back to the 3D view, which is why FocusNameField is off by default.

Duplicate labels

If duplicate labels aren't allowed, FreeCAD adds a suffix to the label. The field shows the final label once you finish editing.

Widget search cost

findChildren walks the whole main-window widget tree on each watchdog tick. This hasn't been noticeable, but it isn't free.

No translation

The interface text is English only. Default-name detection uses the internal Name, which isn't translated, so it works in any language.

Proposal for core

Most of the addon's code exists to work around the lack of a hook. In core, the feature could be small and robust: