Scanning for a rogue linestyle/line pattern

Hello to the folks,

I am new to the forum and Dynamo too. I have a task at hand to hunt through a directory of revit files (rvt, rfa, rte) and locate the file which has an obsolete set of line pattern, line style and fill pattern.

I was able to figure out how to do that in current file but have been failing quite miserably at doing the same with a bunch of files in a target folder.

Pointers would be really appreciated.

As i am a noob, if there are guides or text, to understand dynamo better, you can point me to that would be helpful too.

Thanks,
Shaik

I don’t know of a solution, but it will probably require some sort of package which specializes in maintaining standards, or some scripting. I can’t help you with either.

How many files do you need to do?

If the number of files is say, less than 20 and it takes each file one minute to open and the script can be run from dynamo player, it probably doesn’t make sense to invest the time scripting it for multiple files.

If this is going to become a maintenance routine (running the script at intervals) then scripting it by openings the documents in the background makes sense.

Thanks for your response

Thing is this rogue element keeps popping into the current work through the family repository. Having a ton of families, developed over time, it is inevitable that it happens. And everytime it happens it requires us to cleanup the file at multiple stages which is a lot of time wasted.

And the families are so many it would be grueling to open them all one by one. If there was a way to read which families are hosting the rogue elements then its easy to fix and am sure will not repeat again.

It’s not a maintenance task but the files are too many to open one by one.

I was able to develop a flow to delete them from the current open file, its just that i am not able to crack how to get the list of lines, line styles from a directory of Revit files.

I found this in a post:

The file is available for download in the post. :wink:

Thanks for getting back on this.

I tried the node but this is what i get.

I copied the code block-out from the custom node.

Try this:

ElementTypes.FromLinkedModel.dyn (13.6 KB)

that was neat, no clue how you did that, it did not allow me to even edit the node.

I am able to extract elements but only from the current file and i do not see an input port for a file path.

I have brought you to my limits!

You need to feed a document to that list. See attached.

Unfortunately, the node does not accept lists and I cannot program in python. :frowning:

It’s toward the bottom of a very very long To-do list, but here is a script that will work for a single document input. You will need to copy that after you have everything set up how you want.ElementTypes.FromLinkedModel.dyn (15.6 KB)

It isnt’ elegant, but you can use the “get item at index” to capture each file and open in the background. You could also use an addition node to get the first group of 10 or 100 and, for example, write that out to an excel file which changes the sheet name dependent on the factor you are feeding into the indexes.

For this kind of job, the best solution is using DA4R (design automation for revit, forge API) or, at least a macro.
It will much, very much faster and safer. Dynamo it’s not intended for operation in multiple files, even if it can.
How can you check the job?

Hi @Shaik,

Welcome to the Dynamo Forum.
You were on the right track in your first post. No need for Python or Forge for this trivial task. You don’t modify anything in the background documents so it doesn’t require any particular resources.
These Rhythm nodes have been around for years.

Exchange the category node with the element type node and it’s done :


LinePattern.dyn (20.7 KB)

1 Like

Eureka, it worked, Thanks Alban. That was pretty much the simplest way anyone could have solved this. I got the FIll Pattern Element filter to work such that the Fill Patterns are filtered to find the target Element Name.

For some reason the nodes for Line Pattern do not comply.

And the last step would be to get the name of the file which contains the filtered Elements. I tried a few nodes to achieve that but its still a mystery. If I can track back the File Name of each element, flatten it and further filter the unique file names it might work, BUT I am not able to track back to the File Name. Any tips?

Thanks for doing the heavy lifting, that definitely took a lot of thinking. I gave it a shot but got stuck on step 2. Any clues what may have went wrong? and is the Rhythm node obsolete?

I am familiar with Macros in Excel, can try that as an alternate solution to Dynamo. Thanks

If I understand correctly, use the Element to Document node.
Element to Document

You need to get rid of the quotation marks in the strings input. They are not needed.

C:\User\UserName\FolderX\etc

instead of

“C:\User\UserName\FolderX\etc”

Which Rhythm package are you using?

Apparently I am using a package that has been around for even longer!

That did not work. should i separate out the elements and then run this node?

If the input is a list of lists, use the longest lacing :

Holy cows!!! It worked like magic…i ended up changing 2 nodes to match yours exactly. do you think e.Name node made a difference and how did you know which node had to be turned to longest lacing? whats the science?

It works just as i wanted it to.

Thank you all for the amazing support.
@Alban_de_Chasteigner Respect++