Deleting object - detect event

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
marmni
Posts: 45
Joined: Sat Nov 30, 2013 3:53 pm

Deleting object - detect event

Post by marmni »

Hi, I would like to `push out` new version of my PCB mod but two things still left:
1. Is there a possible to detect object on delete event - but from object side (not by adding Observer - but similar to removeSelection).

Code: Select all

a = doc.addObject("App::FeaturePython", 'Explode')
obj = explodeObject(a) 
Is there any function which I can add to class `explodeObject` (standard obj class) and detect delete event?

2.For other object i would like to delete one of available DisplayMode option without rewriting once again modes definitions. I tried to manage this option in viewProvider but without any result.

Code: Select all

layerS = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "layerName")
layerNew = layerSilkObject(layerS)
How do that?
Post Reply