i also registered the problems with obscure constraints in assembly2. But i am not the developer of that workbench and not able to change that behavior.
I made a small macro which toggles the transparency of a whole assembly.
If the first part, the macro has found, is not transparent, the whole assembly changes to transparent mode. (and vice versa back on next run...)
Here is the makro-code:
Code: Select all
import FreeCADGui,FreeCAD
doc = FreeCAD.ActiveDocument
NONTRANSPARENT = 0
TRANSPARENT = 80
desiredTransparency = NONTRANSPARENT
# Get transparency of first visible object
for obj in doc.Objects:
if hasattr(obj,'ViewObject'):
if hasattr(obj.ViewObject,'Transparency'):
if (obj.ViewObject.Transparency == NONTRANSPARENT):
desiredTransparency = TRANSPARENT
break
# set transparency of objects...
for obj in doc.Objects:
if hasattr(obj,'ViewObject'):
if hasattr(obj.ViewObject,'Transparency'):
obj.ViewObject.Transparency = desiredTransparency
klaus