Create surface from polylines in multiple layers and the surfaces not to overlap, and then set color to appear as hatched shading for the different surfaces

I’ve managed to put together a Dynamo script that creates surfaces from polylines located on different layers. The source polylines were assigned varying elevations, and with your previous help I was also able to compute cut and fill volumes successfully.

I have uploaded both the Dynamo script and the DWG file for reference.

I would like to ask whether it is possible to refine the script so that the generated surfaces do not extend beyond or overlap the boundaries of their respective polylines. My goal is for each surface to be strictly confined within the outline of the polyline used to create it.

In addition, I used Object.SetColor to assign different colors to each surface for presentation purposes. I have attached an image showing the desired appearance.

I would like to understand how best to achieve this visual effect:

  1. Should I create separate surface styles with closely spaced contour intervals (e.g., dense major and minor contours) and assign those styles to the surfaces?

  2. Or will Object.SetColor directly control the color of the contours and surface display without the need for custom surface styles?

Any guidance on how to improve the script and achieve a clean, presentation-quality output would be greatly appreciated.

Thanks in advance for your help. files attached are as follows. dwg file,surface colors to show this way, dynamo script,

Yes, it is possible to add a boundary to surfaces using the Surface.AddBoundary node from the Camber package. Also, the polyline needs to be closed.

C3D_AddSurfaceBoundary.dyn (18.0 KB)

My understanding is that:

  • :white_check_mark: simple AutoCAD objects, such as lines and polylines, can be assigned colours using the Object.SetColor or Layer.SetColor nodes, but
  • :cross_mark: complex Civil 3D objects, such as surfaces and corridors, cannot be assigned colours using Object.SetColor or Layer.SetColor nodes, and
  • :white_check_mark: surfaces require a style to change their appearance, which can be done using the CivilObject.SetStyle node.

This thread talks about how to set a surface style.

If you want to automate the creation or editing of surface styles, then you need to check API and use Python to implement changes. (Basically, I don’t know, so let’s see what other users say.)