Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Reviewing Line Styles & Patterns

8 ANTWORTEN 8
Antworten
Nachricht 1 von 9
comptada
761 Aufrufe, 8 Antworten

Reviewing Line Styles & Patterns

Hello folks,

I'm sure this is a common problem, but we have Revit files that have accumulated a lot of junk Line Styles and Patterns over the years.  I would like to be able to compare what we've got, so that I can eventually merge the duplicates (or essentially duplicates) and purge the unused.

 

I am comfortable enough with Dynamo to be able to get an exported Excel document with all of my Line Styles, which includes the Category Name, Line Weight, and Line Color, but the Line Patterns only come out as "LinePatternElement" (not "Center," "Dash," or "Demolished," for example).  My first wish would be to get this broken out so that the name of the Line Pattern is exported as well.  Maybe I am just misunderstanding this part of the node (from Bimorph), so if anyone can help me there, I would appreciate that.

 

My second wish is that I could export the Dash, Dot, Space values of each Line Pattern for comparison.  For example, I have a Line Pattern named "Center" that goes [1/4" Dash, 3/16" Space, 5/8" Dash, 3/16" Space], but along the way someone also created a Line Pattern named "Center 5/8"" that goes [5/8" Dash, 3/16" Space, 1/4" Dash, 3/16" Space].  These Line Patterns are identical, but with a different starting point, which is totally unnecessary, and there are dozens of other similar examples.  If I could get an Excel document showing the different values for Dash, Dot, and Space, I'm confident I could pare these down significantly.

 

I've attached screenshots of my current graph and the resulting Excel output.  Any help would be appreciated!  I am still a bit of a Dynamo rookie (and totally new to Revit API), but am willing to learn to get this resolved.

Beschriftungen (4)
8 ANTWORTEN 8
Nachricht 2 von 9
Alfredo_Medina
als Antwort auf: comptada

If you cannot get more information using Dynamo, try using RevitLookup, as an additional tool for your task.

With RevitLookup you can find the list of line patterns, and then the settings of each segment of each line pattern. It does not have an Export button, but you can see all the data in the dialog box.


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
Nachricht 3 von 9
comptada
als Antwort auf: comptada

[...duplicate post with direct reply below...]

Nachricht 4 von 9
comptada
als Antwort auf: Alfredo_Medina

Thank you Alfredo! That is a great tool that I was aware of, but did not know its full capabilities. I will dive into it and see if it solves my problems (or at least gets me closer).
Nachricht 5 von 9
ralphdenhaan
als Antwort auf: comptada

Hi,

 

For the LinePatternElement you can use this script inside a Python Script node:

 

# Load required libraries
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

# Get the current document from Revit
doc = DocumentManager.Instance.CurrentDBDocument

# Filter for all LinePatternElements in the document
collector = FilteredElementCollector(doc).OfClass(LinePatternElement)

# Create lists to store elements and names
linePatterns = []
names = []

for pattern in collector:
    linePatterns.append(pattern)
    names.append(pattern.Name)

# Package results in a dictionary for clearer output
output = {
    'LinePatternElements': linePatterns,
    'Names': names
}

# Assign the output to the OUT variable
OUT = output

 

ralphdenhaan_0-1695910686374.png

 

 

 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

Nachricht 6 von 9
comptada
als Antwort auf: ralphdenhaan

Thanks Ralph, this is definitely a step in the right direction.  A few questions/issues:
1) The "linePatterns" / "LinePatternElements" list is a bit worthless -- it has a similar issue as the original Bimorph node, where it only outputs a list of the phrase "LinePatternElement" over and over.  Maybe this is just an issue on my end -- let me know if it is different for you.

comptada_0-1695933394643.png

comptada_1-1695933992393.png

Below this first list, I get a list that looks like your original screenshot, which is a full export of the Line Patterns in the project, which is a great step in the right direction, though I can't seem to discern what order they are in.  Then again, it is not clear what order the original list from Bimorph is in either.

 

However...

2) What I really need is the list of Line Patterns that are actually used, in the same order as the Line Styles menu.  Your script is pulling all the Patterns in the project, but not the Patterns that are actually assigned to any Style.

comptada_2-1695935449061.png

 

Also, in order to export this list to Excel, I had to remove some of your code that packaged things into a dictionary.  I removed a few lines of code (17, 21, 23-28) and changed line 31 to read [OUT = names] instead.

 

I've attached the latest version of this graph, which is currently outputting to Excel three columns from the Line Styles menu and a fourth column that includes all the Line Patterns used in the project.  I disconnected the Bimorph GraphicsStyle node as well, because it does not provide anything valuable.

 

Thanks again for everyone's input and help so far.

Nachricht 7 von 9
comptada
als Antwort auf: Alfredo_Medina

Hello again Alfredo, I've done some digging into RevitLookup, but can't get to a Line Pattern list. Could you drop a quick step-by-step for me? Thanks!
Nachricht 8 von 9
ralphdenhaan
als Antwort auf: comptada

Hi,

 

I can try to check it for you later, but have you asked your question on the dynamo forums yet?

 

https://forum.dynamobim.com/

 

 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

Nachricht 9 von 9
comptada
als Antwort auf: ralphdenhaan

I hadn't posted there yet, because I was hoping there was a less-complex solution within Revit that I was missing, haha, but I will cross-post there next. Thanks for the suggestion!

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report