You shouldn’t have to call EnableRedraw
when you’re targeting the Grasshopper document (which GHPython does by default). A few more things that might help:
- Use RhinoCommon directly (i.e. instead of rhinoscriptsyntax, see this thread)
- Make an empty mesh and append your mesh building elements onto this (i.e. instead of making and outputting a large list with many items.
- Implement
Mesh.CreateFromBox
to generate your building elements. - Wrap the output mesh in a
GH_Mesh
.
All that said, I wouldn’t expect this (i.e. making and outputting many mesh boxes) to be super expensive.
Also, here’s an example of how to override DrawViewPortMeshes
from GHPython.
Edit: Just realised we’d already discussed some suggestions (e.g. profiling, input/output cost).