Lacing Help (i think!)

Hi All

I’m creating a script which takes a 2D plan of different pavement types and produces a 3D model of the pavement which shows all the different layers of each pavement type.

It takes a Civil 3D Tin surface, and given a boundary and a list of the depths of each layer, tries to create 3D solids representing those layers.

In the dynamo graph I have created a list of dictionaries. Each dictionary holds the information for each area of pavement I want to create solids for. Each dictionary contains the boundary polygon to define the pavements plan area and a list of depths for each of the layers. In the screenshot below, you can see the list of layer depths in the first dictionary is 0.5,1,1.5,2,2.5

The createPavementLayers function is a custom function I have written which takes a surface (actually it takes a list of triangles which it turns into a surface), the boundary string, and a list of depths, and returns the 3D solids of the pavement layers I want to create.

At the moment, my dynamo graph is only producing outputs for the first dictionary in the list. Nothing is getting processed for the subsequent dictionaries.

I think its a lacing issue. I think it’s doing the “shortest” lacing by default because there is only 1 list in the “surfacePolygons” input. This is because I want the same list to be used for all the pavement areas.

I read up about “replication list” and putting after the inputs to control how they lace, but nothing I tried worked.

Can anyone help?

Just in case the issue is in my custom function, here is the code for that function

def createPavementLayers(surfacePolygons:Polygon[],depthList:double[],boundary:PolyCurve){
return = [Imperative]
	surfaceSolidList = [];
	translate = 0;
	i = 0;

	for(depth in depthList)
		solid1 = createPavementLayer(surfacePolygons,depth);
		solid2 = Geometry.Translate(solid1,0,0,-translate);
		surfaceSolidList[i] = solid2;
		translate = translate + depth;
		i = i + 1;

	// Create a solid from the boundary polygon
	boundarySolid = Curve.ExtrudeAsSolid(boundary,100);
	boundarySolid = Geometry.Translate(boundarySolid,0,0,-50);

	// Get the "intersection" solid of this boundary solid
	// with each surface solid
	j = 0;
	paveLayerList = [];
	for(surfaceSolid in surfaceSolidList)
		paveLayerList[j] = Geometry.Intersect(surfaceSolid,boundarySolid);
		j = j + 1;

	return paveLayerList;

def createPavementLayer (surfacePolygons:Polygon[],depth:double){
return = [Imperative]
	individualSolidList = Curve.ExtrudeAsSolid(surfacePolygons, Vector.ByCoordinates(0, 0, 1), -depth);
	finalSolid = DesignScript.Solid.ByUnion(individualSolidList);
	return finalSolid;