# LinePatternElement names

**URL:** <https://forum.dynamobim.com/t/linepatternelement-names/21098>\
**Category:** Revit\
**Created:** [April 17, 2018, 9:36am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098 "2018-04-17T09:36:04Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 17, 2018, 9:36am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/1 "2018-04-17T09:36:04Z")

</div>

Hi,

I have a question about a python code i started with.

My main goal is to use this as a line fill pattern node.The code now collects all the Lines in the project and i can do a name pick. But what i would like is that Python creates a list of all the lines patterns (names) as the OUT value and that you can pick one of the patterns as the line you want to use. Now you have to change the patterns[1] to patterns[3] within the code to get an other pattern. But that isn’t a nice workflow ☹  
Maybe someone with ideas?

![Python](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/1/613a2f5830601d8954d8940f39873c49fccb19a4.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:** [April 17, 2018, 9:45am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/2 "2018-04-17T09:45:22Z")

</div>

You could replace line 15 and down with:

```
output = []    
for i in range(len(patterns)):
    namepick = pattern[i].ToDSType(True)
    output.append(namepick.Name)
OUT = output

```

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

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 17, 2018, 2:04pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/3 "2018-04-17T14:04:42Z")

</div>

Thanks!

This is what i searched for 🙂

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 21, 2018, 8:18pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/4 "2018-04-21T20:18:50Z")

</div>

Final result

 ![Filter](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/e/ce1864a0771d71d83c812b954c75d10b0afc5197.JPG)

---

<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:** [April 22, 2018, 10:25am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/5 "2018-04-22T10:25:38Z")

</div>

Nice! 🙂

I just reviewed the code and this is more efficient:

```
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
output = []    
for type in FilteredElementCollector(doc).OfClass(LinePatternElement).ToElements():
    namepick = type.ToDSType(True)
    output.append(namepick.Name)
OUT = output
```

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 22, 2018, 7:03pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/6 "2018-04-22T19:03:54Z")

</div>

Thanks!!!

I used your code part to create the filter node. So it was very helpfull to understand python a little bit 🙂

I only can’t find the Id for a Solid line when you decide you don’t want an other pattern. Do you know where to find this?

For other users, this was the basic part as a start to make this code/node:

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/0/50bfa49146eda7f8296099e94032403ee7fa9e10.JPG)

---

<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:** [April 23, 2018, 8:37am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/7 "2018-04-23T08:37:16Z")

</div>

Have a look here:  
[https://forums.autodesk.com/t5/revit-api-forum/linepattern-definition-from-graphicsstyle/td-p/4880416](https://forums.autodesk.com/t5/revit-api-forum/linepattern-definition-from-graphicsstyle/td-p/4880416)  
and here:  
[http://www.revitapidocs.com/2015/e52c87b7-4544-372f-70a6-00188f6fd252.htm](http://www.revitapidocs.com/2015/e52c87b7-4544-372f-70a6-00188f6fd252.htm)

The “solid” is special and is not really a line pattern (even tough it looks that way). It can however be set using:  
“ProjectionLinePatternId” of the “OverrideGraphicSettings” of a category the Id of the Solid “pattern” is: -3000010

---

<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:** [April 23, 2018, 8:55am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/8 "2018-04-23T08:55:32Z")

</div>

Hi @vanlion  
I’ll take the freedom to change the solution back to the original solution as this was in fact the solution to the issue stated in the name (making it easier for other users to find).

This last bit is a “add-on information” for those interested 🙂

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 23, 2018, 9:03am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/9 "2018-04-23T09:03:44Z")

</div>

Only thing that is not so “fancy” with my code is the Pattern input.

Would be nice if you had the possibility to make a drop down node where you can select the pattern

---

<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:** [April 23, 2018, 9:08am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/10 "2018-04-23T09:08:08Z")

</div>

Like this:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c50953e323f0ae4b5f184b93f2159528419fd7f5.png)

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 23, 2018, 9:17am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/11 "2018-04-23T09:17:55Z")

</div>

Yes 🙂

Is that node available in Dynamo 1.2.1?

---

<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:** [April 23, 2018, 9:41am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/12 "2018-04-23T09:41:02Z")

</div>

Can’t speak for 1.2.1 but it is in 1.3.2 🙂

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 23, 2018, 11:02am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/13 "2018-04-23T11:02:30Z")

</div>

Nope can’t find it ☹

---

<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:** [April 23, 2018, 11:13am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/14 "2018-04-23T11:13:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 23, 2018, 11:43am UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/15 "2018-04-23T11:43:37Z")

</div>

Oke but i can’t find it in version 1.2.1 working with an older version of Revit that doesn’t support 1.3.2

---

<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:** [April 23, 2018, 12:00pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/16 "2018-04-23T12:00:12Z")

</div>

I don’t know if this is within your abilities, but you could find the source code for the node on github and simply create it for yourself 🙂

---

<div class="post-metadata">

**Author:** ![vanlion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanlion/32/46722_2.png) [@vanlion](https://forum.dynamobim.com/u/vanlion)\
**Post date:** [April 23, 2018, 12:20pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/17 "2018-04-23T12:20:51Z")

</div>

Oke Always can give it a try.

Python is new for but before i did a lot of things with Ruby and Sketch up.

Where can you find the github source codes from Revit/ Dynamo?

---

<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:** [April 23, 2018, 12:32pm UTC](https://forum.dynamobim.com/t/linepatternelement-names/21098/18 "2018-04-23T12:32:30Z")

</div>

The code is in C#, and the github brach of 1.3.3 is here:

> **[DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo/tree/RC1.3.3_master)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

and for DynamoRevit2018:

> **[DynamoDS/DynamoRevit](https://github.com/DynamoDS/DynamoRevit/tree/Revit2018)**
>
> Dynamo Libraries for Revit. Contribute to DynamoDS/DynamoRevit development by creating an account on GitHub.
