Use Dynamo To Geo 4 Corner Points of Rectangles From Intersecting Polylines

Hi All,

I have an idea for a Dynamo Graph, but I am currently not able to wrap my mind around the logic needed to create it. My idea is to have Dynamo Generate 4 corner points for rectangles from a grid of intersecting polylines (See photo for Grid Example and also attached sample DWG). There could be any number of rectangles in the grid, but would prefer to extract the rectangles starting in the top left corner and move down as shown in the photo. What are the steps needed to accomplish something like this?

Part Catalog Test Drawing 06.dwg (5.0 MB)

Is this the end goal or just an intermediate step in a bigger process?

Intermediate step towards the end of the process. I would go ahead and create the rectangles once I had the corner points.

The rectangles are used for viewport windows

Do you need to start with the Polylines in Model Space? I’m asking because it would be much easier to just create the grid of rectangles directly in Dynamo and then output them to Model Space in the end versus trying to find and group all of the intersection points appropriately.

It could be done in Dynamo. Attached is the Program that creates the grid of polylines and an updated DWG containing an initial grid boundary for testing purposes. The user selects the grid boundary and sets the scale desired and the grid is created.

JJH_CreateGrid.dyn (114.9 KB)

Part Catalog Test Drawing 06.dwg (5.0 MB)

The .dyn attached above creates polylines because that was a fairly simple graph to set up. I was asked if it could be taken a step further and have rectangles created.

Personally I would just do something like this and then send the geometry back to Model Space.

Grid.dyn (17.2 KB)



Something like this could work as a second step in our process. I would need the created grid of rectangles to insert at the top left corner of the overall grid border (see DWG from previous post), and it would need to follow the same orientation/rotation (if the grid border were to be rotated).

If you extract the orientation/ coordinatesystem of that object you could use that as input for your grid, using a translated coordinatesystem.

1 Like

Would you be able to post a quick update to show how this would be done based on the sample DWG and Grid.dyn file? For this example, it is already known that I would need 8 rows and 8 columns of rectangles. Each rectangle would be 980’ wide and 770’ tall. They would then need to be placed in model space so that they fit into the given grid boundary. I am not familiar with translating coordinate systems in Civil 3D.

Uploading: Part Catalog Test Drawing 06.dwg…
Grid.dyn (21.2 KB)