FreeCAD / FreeCAD/FreeCAD

Sketcher: user-defined constraint names lost during copy-paste

Open
#32,697 4 comments 1 reaction 0 assignees View on GitHub
Mod: Sketcher Status: Confirmed
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 15h
Merged PRs (30d)
196

Description

### Problem description

When copy-pasting geometry between two instances of FreeCAD (or between two sketches within the same FreeCAD instance/document), both elements and constraints are copied, but the user-defined names of the constraints are lost and default constraint names are assigned at the destination instead.

### Workbench affected?

Sketcher

### Steps to reproduce

1. Start FreeCAD 1.1.3
2. Select File/New document menu item
3. Click on New Body in Tasks pane
4. Click on New Sketch in Tasks pane
5. Select XY pane (or any other, it does not matter)
6. Select Line tool and draw a horizontal line (ensure that the mouse pointer shows horizontal constraint icon as a hint)
7. In Tasks pane, Constraint list, select a constraint named "Constraint1", press F2 button and change the name to "Test123" (or any other name, does not matter)
8. Press Ctrl-A to select entire contents of the sketch, press Ctrl-C to copy it into the clipboard.
9. Start another instance of FreeCAD 1.1.3.
10. Select File/New document menu item
11. Click on New Body in Tasks pane
12. Click on New Sketch in Tasks pane
13. Select XY pane (or any other, it does not matter)
14. Press Ctrl-V to paste clipboard contents into the sketch.
15. Observe content of the Constraints list in the Tasks pane.

### Expected behavior

Constraints should be copied with their user-defined names preserved ("Test123" name should have been carried over to the destination).

### Actual behavior

Constraints are copied, but their user-defined names ("Test123") is lost and instead a default name ("Constraint1") is auto-assigned.

The same defect occurs even if copying within the same instance of the FreeCAD (within the same document, between several sketches).

**This is a big problem for creating well-structured and well-organized sketches where users rely on giving every constraint a systematic and self-explanatory name in order to maintain design clarity and transparency. Given inherent and persistent lack of ability to name the elements, naming constraints is the only remaining tool for keeping the complex sketches clean and organized, and this ability is lost when copy-pasting. This makes it difficult to use FreeCAD for professional work and complex projects.**

### Development version About Info (in Safe Mode)

```shell
OS: Windows 10 build 19044
Architecture: x86_64
Version: 1.1.3.20260725 (Git shallow)
Build date: 2026/07/25 04:52:02
Build type: Release
Branch: grafted,grafted
Hash: 145529fe741292ff0b3977a01195bf0247425794
Python 3.11.14, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.4, OCC 7.8.1
Locale: English/United States (en_US)
Navigation Style/Orbit Style/Rotation Mode: CAD/Rounded Arcball/Window center
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Light/
Logical DPI/Physical DPI/Pixel Ratio: 96/125.865/1.5
```

### Last known good version (optional)

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start in the Sketcher workbench by reproducing the documented copy-paste steps and tracing how constraints are transferred between sketches and FreeCAD instances. Check where user-defined constraint names are handled during the transfer. Done means a name such as "Test123" remains visible after both cross-instance and same-instance copy-paste.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.