Object cannot be deleted.

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Object cannot be deleted.

Post by triplus »

This object is referenced by other objects and thus cannot be deleted.
On FreeCAD 0.14 i see additional feature/check was added and probably this was added to contain integrity of the part/assembly? I do see a point in adding this feature but i must say it's quite limiting at times. I usually add/delete some circles in sketch that was already extruded to add or remove a hole and adding circles is not problematic but trying to delete one is not possible anymore?

Today i did one part that took quite a few steps to get it right and i had to remove one hole i did at the beginning of the process by editing sketch and this is not possible anymore. Basically the only real solution would be to delete everything and start from scratch if i didn't want to use some "hacks" like new sketch on the surface and extrude to fill the existing hole? Quite frustrating because user has to know exactly down to each hole at the beginning of the process to not create one to many... I am quite sure this will cause real issues/frustrations for a lot of FreeCAD users!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Object cannot be deleted.

Post by NormandC »

When you say v0.14 are you talking about the PPA version based on master git, or an alternate git branch?

Last week I modeled a plate with the first sketch containing an outer rectangle and an inner circle then padded it, then made a second sketch of a circle on the top face of Pad, and pocketed it. I then went back to the first sketch and deleted the circle and I didn't get this problem. But maybe it is a too simple example.

I wonder if we shouldn't move this topic to the PartDesign forum since new development on it is discussed there now.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Object cannot be deleted.

Post by triplus »

FreeCAD daily builds PPA on Rairing Ringtail. For test you can create sketch with inner and outer circle and pad it. After that FreeCAD doesn't allow you anymore to edit the sketch and to delete inner circle.

I can imagine why this was implemented but it severely limits my workflow.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Object cannot be deleted.

Post by NormandC »

OK I confirm this, even with a single sketch and a single pad with no dependency on it. I think it's a bug. I suggest you report it on Mantis.

It's very recent too. I've got a compiled installation of FreeCAD from April 29th that does not do that. Complete version info follows:

Code: Select all

OS: Ubuntu 12.04.2 LTS
Platform: 64-bit
Version: 0.13.2088 (Git)
Branch: master
Hash: 6551cc4d81750a9467628ae60f030f8a623b077c
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
My guess is this commit introduced this behavior: https://sourceforge.net/p/free-cad/code ... da5e94825/

I've moved the topic to the Part Design forum since it's about that specific workbench. I left the shadow topic in Open Discussion.
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Object cannot be deleted.

Post by wmayer »

OK guys, my bad!

On Mantis there was a bug report about deleting an object by accident (e.g. the sketch of a pad/pocket). When refreshing the document later the pad/pocket gets invalidated. Especially if undo/redo is disabled the sketch is permanently lost and then the pad/pocket remains broken. And actually I share the opinion of the bug reporter that it doesn't make much sense to allow to delete objects that are referenced by others and therefore I pop-up the message box that this is not allowed.

However, I didn't realize at this time that we use the same command to remove elements of an object in edit mode (i.e. the case you described). This is clearly a bug and will be fixed ASAP.
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Object cannot be deleted.

Post by wmayer »

Fixed! Now wait for another 24 hours. :roll:
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Object cannot be deleted.

Post by NormandC »

Thanks Werner! :)
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Object cannot be deleted.

Post by triplus »

Great! I feared it was implemented intentionally to preserve integrity of the part/assembly by not allowing to delete anything inside the sketch. And as i understand it was but not for editing sketches and deleting stuff in it but just deleting the whole sketch. Thanks for the fix because it would really break my workflow if i couldn't delete anything in the sketch once some operation was used on it.

This is just an idea/approach and i don't know how complex it would be to implement something like this but what i like is freedom to do anything. What if accidentally deleted sketch could be replaced by new sketch instead?

There would be error message this Pad doesn't have sketch please choose one from the tree view... In the future having Assembly Workbench stuff like this will probably happen regularly? Something is deleted by intention/accident and something else break... What to do next?

Probably trying to limit for stuff like this to happen will probably end up just in severely limited workflow? Approach that allows intentional/accidental operations that brake stuff and just simply to allow to redefine relations might work better?
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Object cannot be deleted.

Post by wmayer »

This is just an idea/approach and i don't know how complex it would be to implement something like this but what i like is freedom to do anything. What if accidentally deleted sketch could be replaced by new sketch instead?
For now I chose the most radical way not allowing the deletion of referenced objects and was waiting for contrary opinions. Here some points:
* It definitely doesn't make any sense to remove the sketch of a pad/pocket and leaving this unchanged because then all objects depending on this pad/pocket are broken, too.
* At the moment there is nothing implemented in the GUI to replace the sketch of a pad/pocket. A special item is 50% implemented in the property editor but I think we should have such a function in the tree view, too.
* Instead of not allowing the sketch we can show a question dialog if the user wants to proceed or not. I think this is a compromise for those who don't want to delete objects by accident and those who want to do it intentionally.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Object cannot be deleted.

Post by triplus »

I see. Yes then i would go for the compromise solution for now. Dialogue could/should ask if user wants to proceed anyway because yes it's true it doesn't make much sense to delete the sketch after Pad was used or to delete object after Drawing of it was made ... but sometimes at least for me this just gets in the way...
At the moment there is nothing implemented in the GUI to replace the sketch of a pad/pocket. A special item is 50% implemented in the property editor but I think we should have such a function in the tree view, too.
Probably you are talking about the new option Source under properties of Drawing View? I see there is an Edit... button but it's functionality isn't implemented yet. Probably this will allow to select different object instead of creating new drawing? Yes something like this to replace deleted sketch from tree view would be great addition but yes for now warning dialogue with both override and the confirm button would work out OK.
Post Reply