# Join surfaces & keep colors?

**URL:** <https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289>\
**Category:** Rhino for Windows\
**Tags:** windows\
**Created:** [September 1, 2022, 3:53pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289 "2022-09-01T15:53:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eobet](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/eobet/32/709711_2.png) [@eobet](https://discourse.mcneel.com/u/eobet)\
**Post date:** [September 1, 2022, 3:53pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289/1 "2022-09-01T15:53:48Z")

</div>

Rhino 7 has per face polysurface colors. Why isn’t there an option to keep different colors when you join surfaces or create a solid? Is there another tool for this I don’t know?

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [September 1, 2022, 4:43pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289/2 "2022-09-01T16:43:53Z")

</div>

Hello- there is not a good way at the moment from single surfaces because single surfaces do not have per face colors assigned - Join pays attention to perface color assignment but these are not possible on single surfaces. I think there is a bug track item to allow this, I’ll see if I can find it, but it may be that it would just be confusing most of the time.

-Pascal

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [September 1, 2022, 5:29pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289/3 "2022-09-01T17:29:48Z")

</div>

Maybe Join now needs a “PreserveObjectColors” option…

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [September 1, 2022, 5:32pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289/4 "2022-09-01T17:32:46Z")

</div>

Yeah, that might be a good thing to try … but it would need to be more ‘granular’ wording (PreserveSurfaceColors or sum’n) since meshes and curves do not support this at all.

-Pascal

---

<div class="post-metadata">

**Author:** ![spb](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/spb/32/635310_2.png) [@spb](https://discourse.mcneel.com/u/spb)\
**Post date:** [September 2, 2022, 3:51pm UTC](https://discourse.mcneel.com/t/join-surfaces-keep-colors/147289/5 "2022-09-02T15:51:21Z")

</div>

The single surface can have a face color, but subobject selection of the face is not possible via the UI ( [Sub-object select face of monoface brep](https://discourse.mcneel.com/t/sub-object-select-face-of-monoface-brep/102546) ).

The following script will set the face color of separate surfaces to their object color if the face color has not already been set (not System.Color.Empty). It can be used before \_Join, \_CreateSolid, etc.

> **Python script**
>
> ```python
> from __future__ import print_function
> import Rhino.DocObjects as rd
> import rhinoscriptsyntax as rs
> import scriptcontext as sc
> 
> from System.Drawing import Color
> 
> def main():
>     
> gBs = rs.GetObjects("Select surfaces", filter=rs.filter.surface, preselect=True)
> if gBs is None: return
>     
> gBs_Mod = []
> sLogs = []
>     
> for gB in gBs:
> rdB = rs.coercerhinoobject(gB)
>         
> if rdB.Attributes.ColorSource == rd.ObjectColorSource.ColorFromLayer:
> layer = sc.doc.Layers.FindIndex(rdB.Attributes.LayerIndex)
> color = layer.Color
> elif rdB.Attributes.ColorSource == rd.ObjectColorSource.ColorFromObject:
> color = rdB.Attributes.ObjectColor
> else:
> sLogs.append(str(rdB.Attributes.ColorSource))
> continue
> 
> rgF = rdB.BrepGeometry.Faces[0]
> 
> if rgF.PerFaceColor != Color.Empty or rgF.PerFaceColor == color:
> continue
> 
> rgF.PerFaceColor = color
> 
> if rdB.CommitChanges():
> gBs_Mod.append(gB)
> 
> if gBs_Mod:
> print("{} surface face colors were modified.".format(len(gBs_Mod)))
> else:
> print("No surface face colors were modified.")
> 
> if sLogs:
> for sLog in set(sLogs):
> print("{} surfaces have {} color source and were not modified.".format(
> sLogs.count(sLog), sLog))
> 
> sc.doc.Views.Redraw()
> 
> if __name__ == ' __main__': main()
> 
> ```
