# Create Beams From CAD works only perpenticular geometry

**URL:** <https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830>\
**Category:** Revit\
**Tags:** revit, geometry, dynamo, autocad\
**Created:** [July 15, 2023, 12:14pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830 "2023-07-15T12:14:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 15, 2023, 12:14pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/1 "2023-07-15T12:14:20Z")

</div>

Finally i managed to create script for creating beams from CAD to Revit by dynamo with the help of this wonderful community. I’m sharing the script and hope someone find and use it and save his/her time. I’d like to take this script one step further.The problem is;

Dynamo can’t create center lines of beam layers when theye are not perpenticular.

 ![resim_2023-07-15_150555840](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/c/5cda9804b32822234562d9f8199137476503de4a.png)

Mr. @jacob.small use to pointed out that BoundingBox method was the issue. But i couldn’t figure out how i create centerlines with another method.  
I’m also sharing my files.

 ![for beams](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/ef4be22e68b2ae1af2f29d37e5d776ff5b03cfa7.png)  
[KİRİŞ.dyn](https://forum.dynamobim.com/uploads/short-url/7LnfCQe5VPyvakqjFMlumGXKv1M.dyn) (72.3 KB)  
[kat1-5.dwg](https://forum.dynamobim.com/uploads/short-url/qDEd0CS2xMyIe2QsklydssXXAur.dwg) (77.4 KB)  
[betonarme örnek.rvt](https://forum.dynamobim.com/uploads/short-url/dBoUlcFmolR9NFYqLyqgv6aCsIm.rvt) (5.4 MB)  
The packages i use  
 ![Packages for beams](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/4/f4c392ea695c5b81253292c5a8c4cb8e729a5d4a.png)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 15, 2023, 12:26pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/2 "2023-07-15T12:26:27Z")

</div>

Hi @arincakkin try element.location curve from genius loci, and if you are 2024 get.actuellocation

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 15, 2023, 12:36pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/3 "2023-07-15T12:36:36Z")

</div>

> [@sovitek](#):
>
> element.location curve

Hi @sovitek element.location curve instead of BoundingBox?

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 15, 2023, 12:58pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/4 "2023-07-15T12:58:19Z")

</div>

arhh i think i misunderstood i talk about the revit beams location line

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 15, 2023, 2:36pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/5 "2023-07-15T14:36:30Z")

</div>

After you filter components of more than one you have sets of curves which are parallel to each other and within a given distance of each other. Surface.ByLoft should make a quick surface for each grouping.

Each of those surfaces has an isocurve at parameter 0.5 at the center line of the beam, and another Isocurve at parameter 0.5 where you’d take a cross section at the middle of the beam, matching the beam width.

The longer of those two is the beam centerline.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 16, 2023, 8:18am UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/6 "2023-07-16T08:18:34Z")

</div>

Hi @arincakkin try something here, could probably help in your case…

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8dd34239fbc4bac23f156df9e5b2c1b3f675be6f.png)  
[KİRİŞ.dyn](https://forum.dynamobim.com/uploads/short-url/5qEInB33bm2Lf22b7dsLfYnyaZ7.dyn) (80.9 KB)

EDIT saw you already have a cad beam layer called BEAM-MID why not just use that instead…it will be much easier

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/3/93fbd29a3bd3da2617c835f397bea2b7d566cba5.png)

[BEAM MID-KİRİŞ.dyn](https://forum.dynamobim.com/uploads/short-url/VBGaDi0I7dOFkGkQbMK0LVVvKq.dyn) (22.2 KB)

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 12:09pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/7 "2023-07-16T12:09:40Z")

</div>

I’m having errors at this step.

 ![for beams4](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff5a9c0c1f839af6b70776ea7c52074d4688a063.png)

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 12:27pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/8 "2023-07-16T12:27:16Z")

</div>

Where is the right place to use Surface.ByLoft ?

 ![for beams5](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/3/434ae3d62971557e998f19f09616daa6c2c9f26d.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 12:30pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/9 "2023-07-16T12:30:49Z")

</div>

Put a watch node on the `in` output of the filter by bool mask so I can review what data types you have and their structure.

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 12:36pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/10 "2023-07-16T12:36:19Z")

</div>

I hope i’ve done correct.

 ![for beams6](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/2/52b9e03acab3a0f9b6f3a1873454f8c0cd3ac203.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 12:42pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/11 "2023-07-16T12:42:47Z")

</div>

Disable the preview for all of the geometry and pull out the first sublist. You have four curves there (and in many of the sublists) when you should only have pairs, and we need to see why.

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 12:54pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/12 "2023-07-16T12:54:15Z")

</div>

![resim_2023-07-16_155349300](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/b/abaff3b8572c95aaace64922b75b4cfd3661f6d5.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 1:16pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/13 "2023-07-16T13:16:04Z")

</div>

Disable all the other geometry - we need to see the visual representation of the first sublist in the background preview and nothing else.

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 1:21pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/14 "2023-07-16T13:21:25Z")

</div>

![resim_2023-07-16_162113131](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/7/8792756db23f14724a8513a381bcc36442021218.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 2:19pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/15 "2023-07-16T14:19:38Z")

</div>

Disable all geometry preview (crtl + A to select all, right click on the background and select disable geometry preview).

Then go to the List.FilterByBoolMask node and wire the `in` output into a code block of `a[0][0][0];`

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 2:39pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/16 "2023-07-16T14:39:39Z")

</div>

finally i did:)

 ![resim_2023-07-16_173928066](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/7/a7fbad25c3aa580a1ed2a76fbaf76f11408138c4.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 2:56pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/17 "2023-07-16T14:56:23Z")

</div>

And there lies the problem. These beams aren’t properly pairing up. You’ll need to look at another method of finding the pairs in the previous step where you grouped by distance. Anything which builds atop that step and doesn’t correct the issue will be insufficient.

One thought: before you group by distance, try trimming the lines by the distance grouping.

---

<div class="post-metadata">

**Author:** ![arincakkin](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arincakkin](https://forum.dynamobim.com/u/arincakkin)\
**Post date:** [July 16, 2023, 2:59pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/18 "2023-07-16T14:59:49Z")

</div>

Thank you for your time. Maybe @sovitek 's method can lead but i got errors with his way

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 16, 2023, 3:27pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/19 "2023-07-16T15:27:00Z")

</div>

Trining n length off the end of the beam and then extending the eventual center point will also work.

Unless you mean the ‘use the content on the beam centerline layer’, which… yes use that if you have it already.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 16, 2023, 4:22pm UTC](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830/20 "2023-07-16T16:22:49Z")

</div>

yeah in my test it work, show an image with nodes expanded before the warnings/nulls…btw have you tried with the centerline layer.

[Next page](https://forum.dynamobim.com/t/create-beams-from-cad-works-only-perpenticular-geometry/91830.md?page=2)
