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

**URL:** <https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747>\
**Category:** Civil 3D\
**Created:** [April 22, 2022, 3:47pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747 "2022-04-22T15:47:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 3:47pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/1 "2022-04-22T15:47:02Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/c/7c042c050ecf71b3b29e7fa97219b1f7f6d2b77b.png)

[Part Catalog Test Drawing 06.dwg](https://forum.dynamobim.com/uploads/short-url/xm60Te1BPHA1bbbb6ewmPmwMyiB.dwg) (5.0 MB)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [April 22, 2022, 4:08pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/2 "2022-04-22T16:08:31Z")

</div>

> [@hestingjj](#):
>
> My idea is to have Dynamo Generate 4 corner points for rectangles from a grid of intersecting polylines

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

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 4:11pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/3 "2022-04-22T16:11:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 4:11pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/4 "2022-04-22T16:11:58Z")

</div>

The rectangles are used for viewport windows

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [April 22, 2022, 4:17pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/5 "2022-04-22T16:17:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 4:23pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/6 "2022-04-22T16:23:03Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/h6w5grkiB5XnrtdH2Y3LR4IrQkN.dyn) (114.9 KB)

[Part Catalog Test Drawing 06.dwg](https://forum.dynamobim.com/uploads/short-url/aDLWKUapz0dSPg1jSZ47zKmSY7F.dwg) (5.0 MB)

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 4:25pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/7 "2022-04-22T16:25:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [April 22, 2022, 4:50pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/8 "2022-04-22T16:50:42Z")

</div>

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

[Grid.dyn](https://forum.dynamobim.com/uploads/short-url/t9WkYU88kzL9kBTDPzhN5Ady66t.dyn) (17.2 KB)

![grid](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a24f93dcf1c6fe2cec7a1a3cccd899ccae624243.gif)

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 5:08pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/9 "2022-04-22T17:08:25Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [April 22, 2022, 7:11pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/10 "2022-04-22T19:11:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hestingjj](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hestingjj](https://forum.dynamobim.com/u/hestingjj)\
**Post date:** [April 22, 2022, 7:41pm UTC](https://forum.dynamobim.com/t/use-dynamo-to-geo-4-corner-points-of-rectangles-from-intersecting-polylines/75747/11 "2022-04-22T19:41:21Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/iqED3eaozAFFUSV7ApwBngOKKHB.dyn) (21.2 KB)
