Sketcher: Entity and Dimension Colours

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
ideasvacuum
Posts: 17
Joined: Thu Mar 14, 2019 3:08 pm

Sketcher: Entity and Dimension Colours

Post by ideasvacuum »

Is there a way to change the colour of Entities and Dimensions? When using the Sketcher to workout a complex layout (it is not going to be used to produce a 3D model), it would be really helpful to colour code them.
mario52
Posts: 3659
Joined: Wed May 16, 2012 2:13 pm

Re: Sketcher: Entity and Dimension Colours

Post by mario52 »

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.
ideasvacuum
Posts: 17
Joined: Thu Mar 14, 2019 3:08 pm

Re: Sketcher: Entity and Dimension Colours

Post by ideasvacuum »

mario52 wrote: Thu Sep 23, 2021 2:18 pm Hi

Sketcher_Preferences#Colors

mario
Hi mario, thanks but that's not what I'm looking for, it is controlling the defaults so all edges for example are the same colour whereas I want to colour code them (so several colours for edges). Would it be possible to change the colours of some of the edges with a macro?
Bance
Posts: 2264
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Sketcher: Entity and Dimension Colours

Post by Bance »

One can change line colour in the view menu, but I think it is global also.
GeneFC
Posts: 2834
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Sketcher: Entity and Dimension Colours

Post by GeneFC »

ideasvacuum wrote: Thu Sep 23, 2021 1:39 pm Is there a way to change the colour of Entities and Dimensions?
If you are talking about making some lines red and some lines green I believe the answer is no. You can change the color scheme as noted by Mario52, but not separately for individual elements.

gene
ideasvacuum
Posts: 17
Joined: Thu Mar 14, 2019 3:08 pm

Re: Sketcher: Entity and Dimension Colours

Post by ideasvacuum »

If you are talking about making some lines red and some lines green I believe the answer is no.
Yup, that's what I hoped to do, for example a domestic pipe layout would use blue for cold water and red for hot :(
chrisb
Posts: 37794
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher: Entity and Dimension Colours

Post by chrisb »

Inside Sketcher you could use normal geometry and construction geometry - not very smart :roll: .
Outside of Sketcher you could use one sketch for hot and another for cold water and set the line color.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
thomas-neemann
Posts: 3823
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE

Re: Sketcher: Entity and Dimension Colours

Post by thomas-neemann »

ideasvacuum wrote: Thu Sep 23, 2021 1:39 pm
is that a possibility?


https://www.youtube.com/watch?v=6kbuJb2JMFA


phpBB [video]


1157.FCStd
(7.5 KiB) Downloaded 13 times
falls ein video-link von mir schwarz und nicht anklickbar sein sollte, hier der kanal: https://www.youtube.com/channel/UCVcztV ... 03GgKekj_g
es ist auch möglich auf antworten zu klicken um den link zu sehen.
ideasvacuum
Posts: 17
Joined: Thu Mar 14, 2019 3:08 pm

Re: Sketcher: Entity and Dimension Colours

Post by ideasvacuum »

chrisb wrote: Sat Sep 25, 2021 9:18 am Inside Sketcher you could use normal geometry and construction geometry - not very smart :roll: .
Outside of Sketcher you could use one sketch for hot and another for cold water and set the line color.
That sounds interesting, but would I lose the parametrics between those Objects if in separate Sketches - I see can reference an edge from another Object so maybe I just answered my own question. There are of course other separate items that would have their own colours too (but I have used the normal v construction geometry trick just to roll-off a print - and FreeCAD printing is far better than other systems I have used).

I think I can pick a line from one Sketch to use as reference in another, but with up to six Sketches I think it could get messy, especially if a line referenced in that way gets deleted/trimmed/re-orientated. ZW3D has this facility and indeed it does get very problematical if the geometry is complicated.
TheMarkster
Posts: 2689
Joined: Thu Apr 05, 2018 1:53 am

Re: Sketcher: Entity and Dimension Colours

Post by TheMarkster »

You cannot change individual edges in the same object to different colors, but you can change the face colors. So what is needed is a convenient way to convert the edges to small faces. To do this create a small circle in another sketch or you can also use a part workbench circle primitive. Make the radius very small, something like 0.25mm. The circle should be centered on the origin. Select the circle sketch, and then select the other sketch and run the macro. It sweeps the circle on every edge, creating a small cylindrical face. You can then apply the colors to those faces.

But the object produced is not parametric. You would need to run the macro again if changes are made, and go through the process of also setting the colors again. You can make it parametric by editing line #12 PARAMETRIC = True. This is slower because it retains the sweeps as individual document objects. But you will be able to set the sweeps' face colors individually (very tedious because the dialog must be dismissed with each color change) and they will retain that color if you change the sketch as long as it is only a dimensional change and not deleting or adding edges.

If you set the object produced's display mode property (view tab) to shaded you will not see the seamlines.

To set the colors, right click the object in the tree, choose set colors from the menu.
Snip macro screenshot-467eb9.png
Snip macro screenshot-467eb9.png (34.46 KiB) Viewed 319 times
Attachments
colors_example.FCStd
(24.39 KiB) Downloaded 14 times
isocurve_to_mesh.FCMacro
(4.65 KiB) Downloaded 13 times
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
Post Reply