Codeblock coding problems

Hello guys, I’m having some troubles with dynamo codeblocks coding, maybe some of you see something. I’m learning this new technology.

Error: “,” expected

"input";
srf = surface;
h = height;
rectsizeX = x;
rectsizeY = y;

"make a square grid";
bCrvs = Surface.PerimeterCurves(srf);
ftcrvs = List.Flatten(bCrvs,-1);

item0 = List.GetItemAtIndex(ftcrvs,0);
item1 = List.GetItemAtIndex(ftcrvs,1);
item2 = List.GetItemAtIndex(ftcrvs,2);
item3 = List.GetItemAtIndex(ftcrvs,3);

leng0 = Curve.Length(item0);
leng1 = Curve.Length(item1);
leng2 = Curve.Length(item2);
leng3 = Curve.Length(item3);

plsrf = Rectangle.ByWidthLength(leng0,leng1);
plsrf1 = Surface.ByPatch(plsrf);

plpt = Surface.CoordinateSystemAtParameter(plsrf1,0,0);

rect = Rectangle.ByWidthLength(plpt, rectsizeX,rectsizeY);
curves = PolyCurve.Curves(rect);
ftrec = List.Flatten(curves,-1);


itemA = List.GetItemAtIndex(ftrect,0);
itemB = List.GetItemAtIndex(ftrect,1);
itemC = List.GetItemAtIndex(ftrect,2);
itemD = List.GetItemAtIndex(ftrect,3);

ptA = Curve.PointAtParameter(itemA, 0.5);
ptB = Curve.PointAtParameter(itemB, 0.5);
ptC = Curve.PointAtParameter(itemC, 0.5);
ptD = Curve.PointAtParameter(itemD, 0.5);

dist1 = Autodesk.Geometry.DistanceTo(ptA,ptC);
dist2 = Autodesk.Geometry.DistanceTo(ptB,ptD);

u = 0..leng0..dist1;
v = 0..leng1..dist2;

vect1 = Vector.XAxis;
vect2 = Vector.YAxis;

array = Autodesk.Geometry.Translate(rect, u<2>, v<3>,0);

recrvs = PolyCurve.Curves(array);
ftcrv = List.Flatten(recrvs,-1);

bb = BoundingBox.ByGeometry(ftcrv);
box = BoundingBox.ToCuboid(bb);
top = Topology.Faces(box);
bsrf = Face.SurfaceGeometry(top);

ftlist = List.Flatten(recrvs,1);

item00 = List.GetItemAtIndex(ftlist@L2<1>,0);
item11 = List.GetItemAtIndex(ftlist@L2<1>,1);
item22 = List.GetItemAtIndex(ftlist@L2<1>,2);
item33 = List.GetItemAtIndex(ftlist@L2<1>,3);

parm = 0..1..#5;
parm0 = Curve.PointAtParameter(item00<1>, parm<2>);
parm1 = Curve.PointAtParameter(item11<1>, parm<2>);
parm2 = Curve.PointAtParameter(item22<1>, parm<2>);
parm3 = Curve.PointAtParameter(item33<1>, parm<2>);

uv0 = Surface.UVParameterAtPoint(bsrf<1L>, parm0<1l>);
uv1 = Surface.UVParameterAtPoint(bsrf<1L>, parm1<1l>);
uv2 = Surface.UVParameterAtPoint(bsrf<1L>, parm2<1l>);
uv3 = Surface.UVParameterAtPoint(bsrf<1L>, parm3<1l>);

"uv_0";
u0 = UV.U(uv0);
v0 = UV.V(uv0);

"uv_1";
u1 = UV.U(uv1);
v1 = UV.V(uv1);

"uv_2";
u2 = UV.U(uv2);
v2 = UV.V(uv2);

"uv_3";
u3 = UV.U(uv3);
v3 = UV.V(uv3);

pts0 = Surface.PointAtParameter(srf,u0,v0);
crv0 = NurbsCurve.ByPoints(pts0);

pts1 = Surface.PointAtParameter(srf,u1,v1);
crv1 = NurbsCurve.ByPoints(pts1);

pts2 = Surface.PointAtParameter(srf,u2,v2);
crv2 = NurbsCurve.ByPoints(pts2);

pts3 = Surface.PointAtParameter(srf,u3,v3);
crv3 = NurbsCurve.ByPoints(pts3);

The error should be pretty straight forward. There’s an expected “,” missing somewhere, likely for a list. The easiest thing to do would be to split up your code until you can determine where.

2 Likes