algorithmic modeling for Rhino
hello,
i am working on a plugin which needs access to grasshopper. everything works well on the document and server level. But i cannot find any method to access the geometry data within Grasshopper.Kernel.IGH_DocumentObject to bake the data.
with best regards
Michael Sprinzl
Grasshopper.Kernel.GH_DocumentServer docServer = Grasshopper.GH_InstanceServer.DocumentServer;
Grasshopper.Kernel.GH_Document doc_grass = docServer[0];
Grasshopper.Kernel.IGH_DocumentObject grass_node = find_node(doc_grass, "bake");
private Grasshopper.Kernel.IGH_DocumentObject find_node(Grasshopper.Kernel.GH_Document grasshopper_document,string pathname)
{
Grasshopper.Kernel.IGH_DocumentObject grass_node = grasshopper_document.Objects[0];
for (int i = 0; i < grasshopper_document.Objects.Count; i++)
{
if (grasshopper_document.Objects[i].Attributes.PathName == pathname)
{
grass_node = grasshopper_document.Objects[i];
}
}
if (pathname != grass_node.Attributes.PathName)
{ return null; }
else
{return grass_node;}
}
Tags:
Hi Michael,
that's because not all IGH_DocumentObjects have geometry to Bake. Scribbles and Text Panelsdon't, neither do Slider and Colour Swatches.
All objects that have Geometry will implement the Kernel.IGH_BakeAwareObject interface. So you'll first need to check whether an object implements that interface and then you can cast it and call the BakeGeometry method.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
thanks david worked very well... I have some plugin attached to show the raw way what I want to achieve. So copy the folder somewhere and then install the plugin... It is still very buggy.
use the shiva_config command and set to the bake plugin. cancel then ... then use the shiva_fire command
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by