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.
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.
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:
Here's all parts together:
I uploaded the wrong picture on my previous post, this is the correct image for my question.
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.
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.
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.