# Walls from lines from CAD inserts

**URL:** <https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005>\
**Category:** Revit\
**Created:** [September 17, 2018, 11:43am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005 "2018-09-17T11:43:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 17, 2018, 11:43am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/1 "2018-09-17T11:43:01Z")

</div>

Hi  
I want to create a workflow like this.

- Extract Lines from CAD link/insert.  
\*Segregate pairs as per the wall thicknesses.  
\*Identify the longer line of the pair.  
\*Create wall based on that line.  
While I have been able to create this partially. But since the node Springs.Geometry.GroupByDistance has some limitations. You can filter lines which are nearer to each other than the specified distance, I am forced to create different thickness wall lines on different layers to branch out work flow. This works but not a very smart way to do. Is there a node (or script ) where the lines can be grouped (paired) based on their distances from each other. Enclosing the file : [Walls from line on CAD insert.dyn](https://forum.dynamobim.com/uploads/short-url/t4BiKGQJ0Rw2TMBgLyysvfp2KEN.dyn) (75.6 KB)

---

<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:** [September 17, 2018, 1:07pm UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/2 "2018-09-17T13:07:03Z")

</div>

Got a dwg with the standards you are trying to build this off of? An even starting points will matter here.

---

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 17, 2018, 2:32pm UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/3 "2018-09-17T14:32:29Z")

</div>

Basically in A-Wall layer. Right now wall thicknesses 100 , 200, 150 mm. But depending on project can be modified to 115 , 230 mm etc.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 17, 2018, 10:35pm UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/4 "2018-09-17T22:35:50Z")

</div>

It is possible to automate the workflow to set the wall types :

![Convert%20CAD%20lines%20to%20walls%20V2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/d/5df6890a1fac7273edec61df3e6d15357598670f.png)

 ![Convert%20CAD%20lines%20to%20walls](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/b/5b8c2770db2e1e18fca9d0232e0e0709210b2697.jpeg)

 ![Convert%20CAD%20lines%20to%20walls%202](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/4/64830b31d4d8b64fbecbce67e39e95c3f09b9bbb.jpeg)

---

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 18, 2018, 3:51am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/5 "2018-09-18T03:51:28Z")

</div>

Hi  
This is very interesting approach. You are modifying the walls once they are created. Could you share the .dyn file please?

---

<div class="post-metadata">

**Author:** ![abdallaaalaa](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@abdallaaalaa](https://forum.dynamobim.com/u/abdallaaalaa)\
**Post date:** [September 19, 2018, 6:43am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/6 "2018-09-19T06:43:01Z")

</div>

That topic is so interesting …i read all the dynamo workflow from @Alban_de_Chasteigner …but the code block DSCore.String.Concat (DSCore.List.Clean…etc didn’t appear clearly for me …

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 19, 2018, 7:55am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/7 "2018-09-19T07:55:06Z")

</div>

Hi,

You’re right, the code block is not fully readable.  
This is a definition by Vikram\_Subbaiah to collect the numbers in strings.

`DSCore.String.Concat(DSCore.List.Clean(DSCore.String.ToNumber(DSCore.String.Split(s,"")),false)+"");`

---

<div class="post-metadata">

**Author:** ![abdallaaalaa](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@abdallaaalaa](https://forum.dynamobim.com/u/abdallaaalaa)\
**Post date:** [September 19, 2018, 9:10am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/8 "2018-09-19T09:10:05Z")

</div>

I tried the code but it gives me some errors \>\>\>any advice

 ![To%20Help](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/e/1e438aa57a8393e1a313e9cd7d622db06a047484.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 19, 2018, 9:12am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/9 "2018-09-19T09:12:20Z")

</div>

You’re passing “null”

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1a8ef418d5305eeaf9ed1e489620e68a74f1c8a4.png)

---

<div class="post-metadata">

**Author:** ![abdallaaalaa](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@abdallaaalaa](https://forum.dynamobim.com/u/abdallaaalaa)\
**Post date:** [September 19, 2018, 9:20am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/10 "2018-09-19T09:20:51Z")

</div>

what can i fixed this problem of null\>\>\>plz

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 19, 2018, 9:22am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/11 "2018-09-19T09:22:44Z")

</div>

It is for the record never good to just “use” a graph without understanding what is going on under the hood…

The codeblock work as follows:  
If the input is _ **bigger than 0** _ AND _ **smaller than 400** _ it will allow the input through, if the input is outside this interval it will return “null”.

My guess is that @Alban_de_Chasteigner uses it to make sure to only get thickness of walls and not lengths etc.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 19, 2018, 9:37am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/12 "2018-09-19T09:37:37Z")

</div>

@Jonathan.Olesen is absolutely right.

The input for the margin in Springs.Geometry.GroupByDistance can be a simple codeblock with your maximum wall thickness.

In my example above, I assumed that there was no wall thicker than 400 mm.

---

<div class="post-metadata">

**Author:** ![abdallaaalaa](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@abdallaaalaa](https://forum.dynamobim.com/u/abdallaaalaa)\
**Post date:** [September 19, 2018, 10:14am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/13 "2018-09-19T10:14:50Z")

</div>

i think the error is here not in code block (in geometry.distance to node gives me one result not lists of lines

 ![Picture1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/04595af94b064084b8568e75303ed6660480970d.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 19, 2018, 10:16am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/14 "2018-09-19T10:16:36Z")

</div>

Because yousee using code block to only ask for distance between two lines?

---

<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:** [September 19, 2018, 8:20pm UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/16 "2018-09-19T20:20:57Z")

</div>

> [@Jonathan.Olesen](#):
>
> It is for the record never good to just “use” a graph without understanding what is going on under the hood…

This. 1 million times over.

---

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 21, 2018, 3:46am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/18 "2018-09-21T03:46:57Z")

</div>

Hi @Alban_de_Chasteigner  
Tried to recreate the workflow. I am getting some error as attached. And also not getting walls in correct location. Could you look in to this and advice?

 ![21-09-2018%200912](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8b17db133bcfc595592efac2ef593324dbfc5e1f.png) [wall from cad trial.rvt](https://forum.dynamobim.com/uploads/short-url/vdpQGpfrxzZ9X6sUGy9jCCo7NyE.rvt) (1.5 MB)  
[Walls from line on CAD insert-NEW.dyn](https://forum.dynamobim.com/uploads/short-url/y8pDvsEVZJPJolwenhSxTiMY3wN.dyn) (89.2 KB)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 21, 2018, 8:52am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/19 "2018-09-21T08:52:41Z")

</div>

Your autocad import is the main problem.  
It is better to use polylines than lines in Autocad.  
[wall from cad trial.dwg](https://forum.dynamobim.com/uploads/short-url/uCRTy2jdfipTiYJOhG8YBG8e8ga.dwg) (19.6 KB)

There was also a problem with the order of the transactions.  
It can be resolved with Transaction.End and Transaction.Start nodes.

 ![Transaction](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/2/222a3368e3ddcf0532728e528ddd7875c9e22900.png)

---

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 21, 2018, 10:18am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/20 "2018-09-21T10:18:38Z")

</div>

Tried with pline and the nodes you have mentioned. Still not getting the geometry correctly.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 21, 2018, 10:35am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/21 "2018-09-21T10:35:54Z")

</div>

Can you show the Revit result and the errors in your graph ?

---

<div class="post-metadata">

**Author:** ![abhijeetraje](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@abhijeetraje](https://forum.dynamobim.com/u/abhijeetraje)\
**Post date:** [September 21, 2018, 11:07am UTC](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005/22 "2018-09-21T11:07:48Z")

</div>

For some reason Dynamo and revit are crashing as soon as I open the dyn file. Trying restarting the pc. Even installed latest dynamo version.

[Next page](https://forum.dynamobim.com/t/walls-from-lines-from-cad-inserts/26005.md?page=2)
