Problem with using def function

I defined it as a function, but the return value is different from the node above.
Please tell me the solution.

def CurveVertex(input)
{
curve = input;
param = [0, 1];
pt1 = Autodesk.Curve.PointAtParameter(curve, param<2>);
pt2 = DSCore.List.Flatten(pt1, -1);
pt3 = Point.PruneDuplicates(pt2, 0.001);
return = pt3;
};

Right now the code is working on a per-curve level. Try specifying the rank of the input:
def CurveVertex(input : var [])

You’ll also most likely need to iterate each curve and get its end points because the line:

pt1 = Autodesk.Curve.PointAtParameter(curve, param<2>);

will work in imperative execution mode if I remember correctly.

def

def CurveVertex (crv:var[]..[],prm:var[]..[])
{
	pt1 = crv.PointAtParameter(prm<1>);
	pt2 = List.Flatten(pt1,-1);
	pt3 = Point.PruneDuplicates(pt2,0.001);
	return pt3;
};

You’re referring to the use of Replication Guides and mean ‘will NOT’, I suppose

2 Likes

@Dimitar_Venkov @Vikram_Subbaiah
Resolved. Thank you!

If you know of any reference pages on how to fill out codeblock and function, please let me know!

1 Like

@jj06jj here you go
DesignScriptGuideV2.1.pdf (343.2 KB)

1 Like

@Marcel_Rijsmus
Thank you!