I am trying to create a component using the context components in Grasshopper and the new script editor in Rhino 8. Is there a way return the geometry from a component?
Currently, I see only two components to get an output out of the component.
Context print
Context bake
None of them will help in previewing result geometry.
@Devang_ChauhanContext Print and Context Bake do not have a specific geometry type. The way to choose a specific parameter for output is to group a parameter and name it RH_OUT: <name> where <name> is the output parameter name. This way the published component will adopt that type.
I am also working on grasshopper components using the script editor with context components as @Devang_Chauhan was in April.
As an example, if my custom component outputs a line, it doesn’t appear in Rhino unless I attach a standard GH line component to the custom component output. Is there a way to make the custom component preview that line without having to attach a standard GH line component? Perhaps there is a method/syntax to make this possible?
This is an example of a context component (embedding a grasshopper definition with contextual inputs and outputs) that shows previews on the output (A, B, C, …)
Would you mind sharing a gh definition and published plugin that does not show preview?
Published Context Component in action. See the preview in Rhino viewport matching with image below from source gh definition
I hopped on here to say that I hadn’t updated Rhino since July.
I updated it a moment ago, and now the context component previews geometry as I’d expect a component to preview! All I had to do was change the original definition to have a context bake for the output as you show above, instead of the RH_OUT group method.
I want to mention I got an error message when publishing using the group RH_OUT: method. The version I am running is the latest version, but the warning assumes I’m not? Regardless, I don’t see a need to use the RH_OUT method anymore, since its working with a context bake component.