View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000755 | FreeCAD | Feature | public | 2012-06-16 08:50 | 2013-10-30 08:37 |
Reporter | shoogen | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.12 | ||||
Fixed in Version | 0.14 | ||||
Summary | 0000755: Add a Feature to delete a whole subtree of the FeatureTree | ||||
Description | Add a new 'delete' Feature that delete the selected Object and all (indirect) Children that are only referenced in in the selected Objects and its (indirect) Children. Keyboard shortcut could be SHIFT-DEL | ||||
Additional Information | This would be helpful to prepare a file for project merging. | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
python implementation: import FreeCAD def removesubtree(objs): def addsubobjs(obj,toremoveset): toremove.add(obj) for subobj in obj.OutList: addsubobjs(subobj,toremoveset) toremove=set() for obj in objs: addsubobjs(obj,toremove) checkinlistcomplete =False while not checkinlistcomplete: for obj in toremove: if (obj not in objs) and (frozenset(obj.InList) - toremove): toremove.remove(obj) break else: checkinlistcomplete = True for obj in toremove: obj.Document.removeObject(obj.Name) import FreeCADGui removesubtree(FreeCADGui.Selection.getSelection()) |
|
As you said in the description, it is possible that an item in the tree is used elsewhere in an other item's tree, so the code would have to check for this before deleting. |
|
the function is available in the OpenSCAD workbench. Unless there is a demand for a global key binding, we can close the ticket. |
|
OK. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-06-16 08:50 | shoogen | New Issue | |
2012-06-24 18:08 | shoogen | Note Added: 0002238 | |
2012-06-24 18:21 | shoogen | Note Edited: 0002238 | |
2012-07-01 05:16 | jmaustpc | Note Added: 0002253 | |
2013-10-29 16:51 | shoogen | Note Added: 0003830 | |
2013-10-30 08:37 | wmayer | Note Added: 0003832 | |
2013-10-30 08:37 | wmayer | Status | new => closed |
2013-10-30 08:37 | wmayer | Resolution | open => fixed |
2013-10-30 08:37 | wmayer | Fixed in Version | => 0.14 |