Grasshopper

algorithmic modeling for Rhino

Hi,

is there an example on how one could override the bake functionality of a c# component.

I am trying to bake a bunch of lines and breps with a color and materials assigned. I would like to attach this behavior to the general "bake" behavior of the component. Right now I have a boolean input that triggers the baking but I think this is not very elegant.

Any help or suggestions are greatly appreciated.

Best,
T

Views: 467

Replies to This Discussion

Just override your component's BakeGeometry Method:


public override void BakeGeometry(Rhino.RhinoDoc doc, List<Guid> obj_ids)
{
//put your code here
}

public override void BakeGeometry(Rhino.RhinoDoc doc, Rhino.DocObjects.ObjectAttributes att, List<Guid> obj_ids)
{
//I think this one gets called when you bake from the popup dialog. You can have it call the other method if you'll be
//defining your attributes yourself.
BakeGeometry(doc, obj_ids);
}

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service