I am trying to get this to work in a ghhops_server with flask.
TryGetPolyline
()
Several types of Curve can have the form of a polyline including a degree 1 NurbsCurve, a PolylineCurve, and a PolyCurve all of whose segments are some form of polyline. IsPolyline tests a curve to see if it can be represented as a polyline.
Returns: tuple (bool, rhino3dm.Polyline)
- True if this curve can be represented as a polyline; otherwise, false.
- If True is returned, then the polyline form is returned here.
Return type: (bool, rhino3dm.Polyline)
I am using this code but the hops component is going red.
CODE
curve try get polyline
@hops.component(
“/crvTryGetPolyline”,
name=“Try Get Polyline”,
nickname=“CrvTryPoly”,
description=“Try get polyline”,
inputs=[
hs.HopsCurve(“Curve”, “C”, “Curve to test”)
],
outputs=[hs.HopsLine(“Polyline”, “Poly”, “Polyline”)]
)
def crv_try_get_polyline(curve: rhino3dm.Curve):
polyline = rhino3dm.Polyline()
if curve.TryGetPolyline(polyline):
return polyline
else:
return None
There is no hs.HopsPolyline so I am trying to output a hs.HopsCurve or HopsLine
The warning on the component reads: incompatible function arguments, mmmmm…