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 to patterns within the code to get an other pattern. But that isn’t a nice workflow
Maybe someone with ideas?
You could replace line 15 and down with:
output = 
for i in range(len(patterns)):
namepick = pattern[i].ToDSType(True)
OUT = output
This is what i searched for
I just reviewed the code and this is more efficient:
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
output = 
for type in FilteredElementCollector(doc).OfClass(LinePatternElement).ToElements():
namepick = type.ToDSType(True)
OUT = output
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:
Have a look here:
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
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
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
Is that node available in Dynamo 1.2.1?
Can’t speak for 1.2.1 but it is in 1.3.2
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
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
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?
The code is in C#, and the github brach of 1.3.3 is here:
and for DynamoRevit2018: