# Is it possible to bake rhino Geometry from GH with the "thickness" object property already set?

**URL:** <https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644>\
**Category:** Grasshopper\
**Created:** [July 25, 2018, 9:59pm UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644 "2018-07-25T21:59:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanhage](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/vanhage/32/108753_2.png) [@vanhage](https://discourse.mcneel.com/u/vanhage)\
**Post date:** [July 25, 2018, 9:59pm UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644/1 "2018-07-25T21:59:25Z")

</div>

Hi all,

When I model facades, the files can become quite large and i’m curious if you could bake single surfaces out of GH with the thickness object property pre-applied. In the case of mullions, I can model them as single surfaces and use the thickness object property to apply width without having to create a polysurface. Is this something that can be set up ahead of time in GH so they bake with the properties already configured? Could this be done with curve piping object property with curves as well?

-P

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/e/c/ec5d58e07b2a8b7e0535e2d6beac852b85c0b1b5.png)

Thanks

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [July 26, 2018, 10:07pm UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644/2 "2018-07-26T22:07:35Z")

</div>

Hi Vanhage,

it seems like “Rhino.DocObjects.RhinoObject.Attributes” contains the Thickness flag and infos, but I wasn’t able to isolate it.  
This small script takes the whole “.Attributes” from a referenced geometry, and bake a new geometry using it (giving it the same color, layer, etc, etc, and thickness flag).  
So, set as reference a geometry with thickness flag (you can’t internalize it).

Give it a try.

[Bake.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/0/00fd042438afb02b8706f1f68ba4da8a2ec3e972.gh) (32.4 KB)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [July 26, 2018, 11:52pm UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644/3 "2018-07-26T23:52:18Z")

</div>

See the following:

> [@Surface Thickness Settings](https://discourse.mcneel.com/t/surface-thickness-settings/66583/5):
>
> Hi @jeremy.graham86, It turns out you can access RDK thickness values using [RhinoObject.GetCustomRenderMeshParameter](https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_RhinoObject_GetCustomRenderMeshParameter.htm) and [RhinoObject.SetCustomRenderMeshParameter](https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_RhinoObject_SetCustomRenderMeshParameter.htm) methods. For the providerId parameter, specify the Rhino.Render.CustomRenderMeshProvider.ThickeningId id. The applicable parameter names and data types for thickening are: "on", bool "distance", double "solid", bool "both-sides", bool "offset-only", bool For example, to determine of thickening is enabled on an object, you can do th…

– Dale

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [July 27, 2018, 10:18am UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644/4 "2018-07-27T10:18:34Z")

</div>

Thank you, @dale!

[Bake\_with\_thickness.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/7/67d674f4d60ef3332627572e4432e6a2f2d8f8ec.gh) (45.6 KB)

It tells me “Warning (CS0612): ‘Rhino.Render.CustomRenderMeshProvider’ is obsolete.” … but it works anyway.

> **Click to expand code**
>
> ```
> private void RunScript(GeometryBase tobake, bool thickness_on, double distance, bool offset_only, bool solid, bool both_sides, bool bake)
> {
> if(bake){
> // Adding geometry to rhino file (baking)
> this.RhinoDocument.Objects.Add(tobake);
> 
> // Finding the just-made object and applying wanted thickness parameters
> Rhino.DocObjects.RhinoObject obj = this.RhinoDocument.Objects.MostRecentObject();
> obj.SetCustomRenderMeshParameter(Rhino.Render.CustomRenderMeshProvider.ThickeningId, "on", thickness_on);
> obj.SetCustomRenderMeshParameter(Rhino.Render.CustomRenderMeshProvider.ThickeningId, "distance", distance);
> obj.SetCustomRenderMeshParameter(Rhino.Render.CustomRenderMeshProvider.ThickeningId, "solid", solid);
> obj.SetCustomRenderMeshParameter(Rhino.Render.CustomRenderMeshProvider.ThickeningId, "both-sides", both_sides);
> obj.SetCustomRenderMeshParameter(Rhino.Render.CustomRenderMeshProvider.ThickeningId, "offset-only", offset_only);
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![vanhage](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/vanhage/32/108753_2.png) [@vanhage](https://discourse.mcneel.com/u/vanhage)\
**Post date:** [July 30, 2018, 4:25pm UTC](https://discourse.mcneel.com/t/is-it-possible-to-bake-rhino-geometry-from-gh-with-the-thickness-object-property-already-set/67644/5 "2018-07-30T16:25:18Z")

</div>

@maje90,

This is great thanks for sharing!

@dale,

do you know what the parameter names would be for piping of curves? I’m having trouble with checkbox for “faceted”, any thoughts?

Thanks!
