Is there a way to create a script in Dynamo that can hide a tag based on its value? For example I created a shared parameter for the extension of a duct elbow. Then I made a tag for the parameter. What I would like dynamo to do is hide all tags for this parameter that equal 0".
if your tag is very simple, just a number, then you can access it TagText (string) to see if it’s “0”. Or you can just get the hosts from tags then access the parameter values to see if they are equal to 0. Filtering them.
iterate through the views where u want ur tags to be invisible, hiding them by View.HideElements.
My tag has a prefix of ST and then the value. So if the value is 0" the tag reads ST0". The next problem is I am not where to begin with Dynamo. Would you have a sample script that I could look at for starters?
basically, the idea is to filter tags based on TagText property then hide them in views. (I just hided them in current view.)
And I think this entire guide is worth learning and friendly to starters.
Please have a look at the script below:
Would it be easier just to create a script that only tags the non-0 elements?
It works fine for me as long as the selection contains Tags only. how about replacing Select Model Elements to Tag Category => All Elements Of Category to retrieve all tags in your document.
Your selection contains Duct?
Here is a short screen cast of what is happening when I run this dynamo script. I also posted a sampe revit project.