algorithmic modeling for Rhino
When a certain geometry parameter is created in a grasshopper document, it is being displayed in the viewports in red color AKA preview.
In grasshopper document you can right click the geometry parameter and turn off the preview in the view ports.
My component is drawing to the display pipeline by itself and i want to be able to disable that input geometry parameter's preview - so grasshopper won't preview it.
Hen, If I understand you right you want to turn the preview off for the connected component? and not only an input parameter? Something like this should do it for you:
In this example as soon as you connect a component to x input the preview of the component will be off. You can use a very similar approach and set the input/output parameters to Hidden too.
Mostapha,
I've tried running your code - the problem i came across is that the InstanceGuid from my input parameter was not found in the component list, because it's a IGH_Param and not IGH_Component - for components the following code works.
I'm looking for a way to turn off the preview of ANY GeomteryBase input parameter such as Brep, Surface, Mesh, Etc.
You have to cast whatever parameter you wish to hide to an IGH_PreviewObject interface. If the cast succeeds then you call object.Hidden=True. If the cast doesn't succeed then the parameter doesn't support previewing at all.
All objects on the canvas have InstanceGuids, even input and output parameters to components. However you can also reach these parameters through the GH_Component.Params property, which gives you access to the input+output parameter manager.
--
David Rutten
david@mcneel.com
YES!
thanks david :)
works perfect
m_geo_param = this.Params.Input[0].Sources[0];
IGH_PreviewObject m_geo_prev = m_geo_param as IGH_PreviewObject;
if (m_geo_prev != null)
{
m_geo_prev.Hidden = true;
}
thanks again for your help, mostapha & david :)
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