# Create civil 3d cogo points at line intersections

I am looking to automatically create cogo points at all the intersections of a grid (see image below). There would be a user prompt to select the lines and then cogo points would be created. I have the selection set of lines but don’t see anything to generate the XY values of the intersections. Any help accomplishing this would be appreciated. Thanks

Use the intersection node

Thank you for the quick reply. I was reviewing the intersection node here: Interesction. Is the idea to iterate through each pair of lines and pass them in as bounding boxes? The result being a bounding box for each intersection. Sorry as I am rather new to this I am still getting my bearings straight.

Here’s an example of how you could do it. First, you need to get the AutoCAD lines into Dynamo using the Object.Geometry node. Then you need to find all of the possible intersection points using Geometry.Intersect, which involves iterating through every line and finding the intersection with every other line. Dynamo makes this easy and all you have to do is right-click on the node and set the Lacing to “Cross Product”. You can read more about lacing on the Dynamo Primer:
https://primer.dynamobim.org/06_Designing-with-Lists/6-1_whats-a-list.html

From there, you will end up with extra geometry that you likely don’t want. This is because in addition to finding the intersection points, it will also find the intersection of each line with itself, which is another line. So you’d need to filter out those lines to leave only the points. An Object.Type node combined with a List.FilterByBoolMask node should do the trick.

You’ll also get some null values that you’ll want to remove. This is because not every line intersects with every other line. The List.Clean node can do this.

6 Likes

@mzjensen Thank you very much, this makes sense and I having it working 95% or so. For some reason I was getting duplicate points out of the list.filterbyboolmask (seems like double). Any idea why this would be? To solve it I tried adding a list.uniqueitems but this doesn’t seem to always capture all the duplicates.

Use Point.PruneDuplicates

1 Like

Great, thank you. This worked exactly as expected.