HatchByGeometry kit

Hi, i want to hatch certain geometry that i got in my drawing. I made my geometry with polyline but all i can do with my code is to hatch.bygeometry and it doesnt work with polyline.Is there a solution? Normally i draw my roads, sidewalks and all my geometry in polyline and hatch it manually but i want to make it more quicker with dynamo.

Hi Jerome,

you can convert polyline to polycurves and join this curves. this closed polycurve can be used to create hatch back to civil 3d again.

Ok, i will look for this solution. In the future i wish that polyline will be recognise and save some code.

Can you explain to me how to convert it?

not an expert but hope you are asking for this only

Thanks, but my code works with polycurves, but all my cad drawing are made with polylines. If i understand dynamo is note able to hatch a form made by a polyline.

Hi @jerome.raby,

Welcome to the forum. The process that @shahid.shaikh_C3D outlined is what you should do.

Perhaps a discussion about object types would be helpful here. Dynamo has it’s own set of object types that are independent from AutoCAD or Civil 3D object types. Polylines are great examples - a Polyline is an AutoCAD object, and the corresponding Dynamo object is a Curve, of which a PolyCurve is a subset. You can read more about that here:

If you hover over the “boundaries” input port on the Hatch.ByGeometry node, you will see that it requires a PolyCurve input, which is why @shahid.shaikh_C3D said that you need to “convert” the Polyline to a PolyCurve using Object.Geometry. This aligns with the general approach to constructing a Dynamo graph:

  1. Select objects/elements in host application (Civil 3D)
  2. Convert objects to Dynamo objects (Polyline → PolyCurve)
  3. Perform Dynamo operations (not applicable here, but very common in more complex graphs)
  4. Output result back to host application or dump to external file (Civil 3D, Excel, etc.)

Is it possible to create a hatch which is associative with the boundary object?

Hi @shahid.shaikh_C3D

Can we put different hatch patterns for different objects ,in the thing which you have shown above.

Hi @wardhanraj if you look closely, the second input is hatch pattern and so is there the other inputs about hatch.

if you are wondering about input this might help you.

Yes.Thanks for reply.

Can we have different hatch patterns,if there are many objects?

Yes, you have to play with list levels. you can have a list of objects and list of hatch patterns.