With this macro you can set individual colors and transparency levels of faces, edges, and points. Select the subobjects and run the macro. The color picker dialog comes up:
Select the color and alpha level as desired, and press okay.
Special note on alpha: the default 255 would make the color fully transparent, which is not what will be typically wanted, so I inverted this value to mean fully opaque and 0 = fully transparent.
https://wiki.freecadweb.org/Macro_Colorize
Notice with this cube some of the edges are red and some are default black:
Macro Colorize
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Macro Colorize
Works with sketches, too, but not with the editor open. I guess the editor overrides those colors, but this is a good thing because edge color inside the editor gives a lot of useful information.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Macro Colorize
This can be useful for peeking inside a solid, by making one or more faces transparent and setting the ViewObject Lighting property to Two side.
Re: Macro Colorize
Can this be used to select inner faces for FEM wb as described e.g. here https://forum.freecadweb.org/viewtopic. ... 70#p146370?TheMarkster wrote: ↑Sun Dec 12, 2021 2:12 am This can be useful for peeking inside a solid, by making one or more faces transparent and setting the ViewObject Lighting property to Two side.
Snip macro screenshot-992012.png
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Macro Colorize
The transparent face still gets preselected when the mouse is hovered over it, and although the preselection is only semi-transparent it still blocks you from selecting objects behind it. I tried turning off color on preselection, but it still blocks you from selecting another face from the inside.
Re: Macro Colorize
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.