This is old code for baking objects with colors.  It still seems to work for surfaces and BReps, but doesn't work with curves and lines.  Any ideas?  Also, is there an easy way to add a way to specify the layer for baking?
Thanks.
---
  Private Sub RunScript(ByVal blnBake As Boolean, ByVal obj As OnBrep, ByVal color As Color, ByRef A As Object) 
    If blnBake Then
      'Bake Object
      Dim mObj As New MRhinoBrepObject
      mObj = doc.AddBrepObject(obj)
      'Find obj attributes to change color
      Dim att As New MRhinoObjectAttributes(mObj.Attributes())
      att.SetColorSource(1)               'set color source to From Object
      Dim rColor As New OnColor (color)   'make OnColor
      att.m_color = rColor                'Set Object Color
      'Modify the attributes
      Dim objref As New MRhinoObjRef(mObj.Attributes.m_uuid)
      doc.ModifyObjectAttributes(objref, att)
    End If
  End Sub 
                
             
         
                    Tags: