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: 

Can you use Dynamo to replace line styles of elements?

7 ANTWORTEN 7
Antworten
Nachricht 1 von 8
David125
623 Aufrufe, 7 Antworten

Can you use Dynamo to replace line styles of elements?

I'm trying to clean up our line styles but it takes too long manually. I'm hoping Dynamo can do the following steps:

-Select all instances of Item in project.

-Change line style from "Joe 1" to "1"

-Delete "Joe 1" from line styles.

I'm an infant when it comes to using Dynamo, and I usually make a mess of things with it.

7 ANTWORTEN 7
Nachricht 2 von 8
robert2JCCH
als Antwort auf: David125

Line styles are classified as GraphicsStyle in the Element Type menu in Dynamo.

 

You can get the Line Style of Detail Line elements, and it'll output a list of GraphicsStyle ID numbers. You can use the ID to also retrieve the name of the line style.

robert2JCCH_0-1698438671849.png

You need to know what ID your final line style is, so you'll have to browse the list. You can also attempt to search for it:

robert2JCCH_2-1698438855174.png

Here's all parts together:

Line swap_2023-10-27_01-42-26.png

 

Nachricht 3 von 8
David125
als Antwort auf: David125

Holy moley! I'll give it a shot, thanks.

Nachricht 4 von 8
David125
als Antwort auf: David125

What is the item I circiled in red on attachment?

Nachricht 5 von 8
David125
als Antwort auf: David125

I uploaded the wrong picture on my previous post, this is the correct image for my question.

Nachricht 6 von 8
robert2JCCH
als Antwort auf: David125

Equals operator (==)

 

It checks if something in list 1 is the same as list 2, depending on how you set up the lacing for the node.

 

For this script, the lacing is set to Auto which is defaulting to Longest. All that really means for this use case is that every item in List 1 (name of the line style of the detail line) is checked against the one entry in List 2 (<Hidden Lines>).

 

The output is a list of true + false values, which is then used as a mask to filter the list.

Nachricht 7 von 8
David125
als Antwort auf: David125

I'm using DYNAMO v.2.16.2 , some commands (nodes?) are no longer the same. For example, ELEMENTS OF TYPES

Is no longer available. Also I can't get the CODE BLOCK  to connect to both the STRING and the ELEMENTS OF TYPE. Iv'e uploaded my file.

Nachricht 8 von 8
robert2JCCH
als Antwort auf: David125

Couple of things:

 

At some point (I don't follow newer Dynamo versions yet due to versions used at work), Element Types became Element Classes. Not sure if it's a nomenclature switch or if Classes became all-inclusive. Regardless, you'll want to use Class nodes now.

 

Passthrough node is from the Clockwork Package, which you'll need to install via the Package Manager in Dynamo. Normally, Dynamo attempts to do everything simultaneously, which is a problem if you want to change something then delete the original (imagine it going the other way around). The node basically tells the script "Don't do this section until this other section is done". You can do this with normal Dynamo nodes (Transactions), but I'm terrible at setting those up so it's simpler to show it via Passthrough. Clockwork is also a very useful package to have, it's got quite a few nodes that can come up in daily work.

 

I looked through the file, I think there are some misunderstandings based on the wiring graphics between nodes (some of the wires graphically pass through nodes in my screenshot but don't actually connect to the node). I rewired the nodes and attached the updated file, hopefully this makes the workflow a bit clearer.

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