Hello everyone,
I am trying to implement some kind of UI to the script previously made ( with the help of some users of this amazing forum! You can find the post on the previous script here.), on counting elements in a certain category and setting values in a certain order.
I will try to explain it in few words:
Basically it takes some categories, then it counts how many elements of this categories are modeled, then applies a value in the mark parameter of each, starting from the first to the last and using a sequence of numbers.
In the last few days I’ve tried to modify a little bit the phyton script, adding also letters as prefix of the number sequence and changing the number of characters accordingly.
This is an example on the air ducts and air fittings.
As you can see in the picture above, on the code block, the naming rule is “category” - “sequence number”, so duc for “Ducts” and duf for “Duct Fittings”, then 001, 002, etc…
This is a very useful script, but now I would like to push it one step further, like adding the UI from the data-shapes package, so users who are not familiar with the Dynamo environment don’t need to open the script, they just need to select a category from the dropdown list.
This is what I have done so far:
Now the question is: how would it be possible to connect the element choosen on the drop down list of the UI (for example Ducts) and push the correct parameter value related to its category? I am talking about duc if the user choose Ducts, cbt for Cable trays, etc…
Would it be possible? Do I need to connect like an external excel file on which Dynamo will read those naming conventions or its necessary to modify the code?
Any help will be more than appreciated! Thanks in advance!