Arch material creates material even if you cancel the operation and the material cannot be deleted

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
hko
Posts: 96
Joined: Thu Apr 23, 2020 10:44 pm

Arch material creates material even if you cancel the operation and the material cannot be deleted

Post by hko »

- Open a new document and select Arch workbench
- Click Material tools -> Material
- Click Cancel
- Observe that you now have "Materials" group in the tree and there is "Material" inside it
- If you do that again, you get Material001 etc.
- Try to delete Material by selecting Delete from the context menu of Material
- Observe that Material is not deleted

- Edit material and choose a preset and click Ok
- Now try to delete Material
- Observe that Material is deleted

Code: Select all

OS: Ubuntu 20.04.5 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: recent master, see hash
Build type: Debug
Branch: master
Hash: 8b85903dffe3a9a02dd3738ea8931f3e52e59463
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.3.0
Locale: English/United States (en_US)
Installed mods: 
  * 3DfindIT 1.2.0
  * Render 2022.3.0
  * BIM 2021.12.0
  * Reinforcement
  * Manipulator 1.4.9
  * Assembly4.backup1662941442.2770898
  * parts_library
  * Assembly4 0.12.5
  * fasteners 0.4.50
  * Silk 1.0.0
  * dodo 1.0.0
  * Curves 0.6.5
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch material creates material even if you cancel the operation and the material cannot be deleted

Post by Roy_043 »

Confirmed. I have a PR prepared related to the edit modes of Arch objects. This PR will also fix the delete problem you mention (FreeCADGui.ActiveDocument.resetEdit() is currently not called when Cancel is pressed).

There is some confusion about how the tool should work. The tooltip "Creates or edits the material definition of a selected object" is not accurate, a new material is always created and you do not have to select an object. Maybe "Creates a new material definition and opens it for editing" would be better. Cancelling the edit operation would still leave you with a new material.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31432 (Git)
Build type: Release
Branch: master
Hash: 63a2855751d638bf27ed969dc60654bda2b54baf
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Dutch/Netherlands (nl_NL)
Installed mods:
Post Reply