I'm new to this forum and I would like start my participation expressing my gratitude to the FreeCAD developers for they wonderful work and results reached as for the date of this post.
I would also like to start participating providing two little but for me useful macros which allows to switch all the objects within a project from opaque to a given transparency value:
To make all solids translucent I've used the following code:
Code: Select all
doc = Gui.activeDocument()
objs = FreeCAD.ActiveDocument.Objects
for obj in objs:
if obj:
o = doc.getObject(obj.Name)
if hasattr(o, 'Transparency'):
o.Transparency = 50
I've found that code useful in conjuction with a custom toolbar created within the preferences and/or with keyboard shortcuts.
Any comment or correction on the code is welcome as I'm not really familiar with Python and its API's.