Hops from CPython and Lists

Hey I am trying Hops from CPython. Example works fine I was just trying to figure out Lists with CPython.

I have this with no compile errors:

    description="Get point along curve",
        hs.HopsCurve("Curve", "C", "Curve to evaluate", access=hs.HopsParamAccess.LIST),
        hs.HopsNumber("t", "t", "Parameter on Curve to evaluate", access=hs.HopsParamAccess.LIST),
        hs.HopsNumber("P", "P", "Point on curve at t")
def pointat(curves, ts):
    return len(curves)

But I am getting Requires at most 0 items in GH. Where do we set this?


Also in order to get autocomplete for list how should we hint that to python? I saw in the examples that you were doing something like that for a single input. Any thought for a list and even a tree?

def pointat(curve: rhino3dm.Curve, t=0.0):
    return curve.PointAt(t)

This was reported yesterday at LIST parameter not supported · Issue #316 · mcneel/compute.rhino3d · GitHub

It is probably an easy fix. We’ll try to take a look at it in the next few days.

1 Like