delete FEM results

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

delete FEM results

Post by bernd »

If the FEM results from an analysis are deleted by pressing the del key or by right click and delete there will be a pop up asking if one really would like to delete the object because it has dependencies to the analysis. This was reported in issue #2080

On the contrary if python is used the popup does not pop up

- start FreeCAD --> start wb --> 3D FEM example --> python code

Code: Select all

App.ActiveDocument.removeObject("CalculiX_static_results")

A grep to Object dependencies

Code: Select all

grep -r "Object dependencies"
finds
src/Gui/MainWindow.cpp: tr("Object dependencies"),
src/Gui/CommandDoc.cpp: qApp->translate("Std_DuplicateSelection","Object dependencies"),
src/Gui/CommandDoc.cpp: qApp->translate("Std_Delete", "Object dependencies"), bodyMessage,

explains why it is not pop up in python, because it only pops up on GUI. Mhh but I do not really know how we could get rid of this popup for the FEM results.
wmayer
Founder
Posts: 20074
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: delete FEM results

Post by wmayer »

This behaviour is implemented directly in the "Delete" command (StdCmdDelete::activated). However, at this point the command doesn't really know the context in which the deletion is performed. Only the view provider should decide if a deletion might break something or not because it knows best the internal structure.

Currently the deletion of FEM results is one of the few examples where this dialog is really annoying but it's not a FEM specific issue, it's a general issue.

I have to think about how to improve all this...
Post Reply