Python grasshopper

Hello guys,
I’m recently making my customized component in python grasshopper, but I’d like to know if there is any way to do the ‘custom preview’ in python like the same in grasshopper?

Thank you very much

I have an idea. Simply output objects that are previewed differently through separate output parameters of the GhPython component. Then you can access all the native components that do the custom previews. If you have way too many outputs, you can try utilizing the scriptcontext.sticky library and manually expire downstream GhPy components that retrieve from said sticky.

Otherwise I’m afraid you’ll have to get into display conduits, which I know nothing about. Too complex for my little brain.

There is, and it’sthe same. You can override the required methods in SDK mode:

IsPreviewCapable
ClippingBox
DrawViewportWires
DrawViewportMeshes

A small example is here: GhPython add-on compiler with example (step 5).