Closed polyline from hatch

Hello all,
Sorry for the bad english. I was hoping to automatically get multiple closed polylines from excisting hatches. In civil or autocad its of course posibble to use: generate boundary, but i cant seem to find this option in dynamo.

@C.N.v.d.Zwaag try:

Hi @C.N.v.d.Zwaag,

Take a look at the Civil 3D Toolkit package. There is a node to get the polycurve boundary of a hatch. It is not necessary to use Python.

1 Like

Yes i saw that C3D toolkit had this package, I am trying to use this node but it places the polylines miles away from where the actual hatch is located. maybe im doing something wrong in the filter part, but im not ceirtain.

thanks for the help btw :smiley:

You are getting the hatches within block definitions, which have coordinate systems that do not correspond with the WCS. Are the desired hatches contained within block references or just in model space?

These hatches are located in the model space. so this might cause the problem.

OK, in that case then the only input you should have for ‘block’ is the model space block.

Document.CurrentDocument.ModelSpace

Yes it works. but it only does when the hatches are created by using the select function not the pick points function :confused:
The information in Hatch.ByObject turns these hatches to: hatch(Loop=0) is there any solution to get the hatch object even if the hatch is created while its created by pick point(s)?

Not sure I understand. Can you show an example?

pick or select


So where you see the loops=0, these are hatches that are made with the pick points tool(see first picture)
the ones that work and return a closed polyline, the ones with a loop=1. these are made with the select tool also in picture 1.

1 Like

I also encountered the same problem, with the “pick points” method for hatch creation, the “hatch.byobject” returns loop=0

FYI @Paolo_Emilio_Serra1


Its not working with curved hatch even when adding polycurve.curves.
Any Help please?

Better regenerate the boundary inside AutoCAD and place them into a particular layer, then can use dynamo to pick them up from that layer.
hatch made via picking inside point is a boundary-associated hatch which may not have a “real” closed boundary curve. I do not think the dynamo code can rebuild the closed boundary curves (if has holes or multiple closed boundaries) well, better use CAD to do that job.