Change revision cloud color based on "Issued to" parameter


#1

Hi. I have been searching for a solution to this problem for some time, but without any effects.
What I am trying to do is to create color overrides for revision clouds (and preferably tags) based on the “Issued to” parameter. This way I want to create different colors for revisions refering to construction, HVAC, etc.
I was trying to do something like in the attached image but: 1. it worked only once (?) and 2. it should work only in one view, whereas I would like it to work in all views. It doesn’t throw any erros, it just doesn’t do anything :slight_smile:


Well, I hope someone can help mi with this. Thanks in advance!


#2

Once you get all KON clouds, you need to get the view they exist in as well. I think there’s a node like OwnerView or something? Can’t check right now, but that would give you the cloud and the view you want to set the overrides for.

You should be able to do the same thing for the tags.


#3

I’ll try it. What could be the reason for it not working? Usually my failed attempts gave some notification but this time there are no errors yet nothing happens.
Also I tried to specify the View by choosing “Level 1” from the list of available views.


#4

Hi,
Here is a little something I cooked up to re-color all the revision clouds of a specific issue on all the sheets within a project. You may be able to adapt this to suit your own needs.

It has been written to run in the Dynamo Player with no-dependencies.

(DP1.3) Override Cloud Color by Revision.dyn (39.0 KB)


Magical Dynamo Player Library
Change line colors
#5

I assume it’s “not working” because you got all your clouds in the entire project and set the overrides for only one view. Since overrides are view specific the element only changes if it exists in the specified view.

If you want to set the overrides for every cloud in every view you have to tell it which view the cloud lives in. Element.OwnerView will do that. Then you can input a list of views with a list elements to override.

It all works. You just have to get the correct list structure and the correct information.


#6

It didn’t work even in the active view. Anyway I will try using the tools both of you mentioned and see if I can get it to do what I need. I’ll get back here when I get some results. Thanks!


#7

Ok, I think it is over my head. Tried using Element.OwnerView - it gives me a list of views where the revision cloud are which is awesome. I plugged it in, but still no results. The revision clouds stay untouched.


I even tried using OverrideColorInView just for the active view, as it seemed to be the simplest thing to do, but still no effect.
The definition provided by Ewan_Opie is too complicated for me at this stage, but I’ll try to understand it :slight_smile:


#8

Ah, you’re filtering the parameter value not the element. You want the All Elements of Category output going into the List.FilterByBoolMask input.


#9

I tried this:


#10

and this:


#11

but nothing happened to the revision clouds.

Only when I tried this, the cloud changed color:


As you mentioned it modifies them only in the active view which is not what I am ultimately trying to achieve.

I really hope my questions aren’t as dumb as I think they are :slight_smile:


#12

What package is your View Set Element Overrides from? I don’t have one like it.
Try using this Python code instead.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
views = UnwrapElement(IN[0])
elements = UnwrapElement(IN[1])
dyncolor = IN[2]

color = Color(dyncolor.Red,dyncolor.Green,dyncolor.Blue)
ogs = OverrideGraphicSettings()


TransactionManager.Instance.EnsureInTransaction(doc)
for v,e in zip(views,elements):
	v.SetElementOverrides(e.Id,ogs.SetProjectionLineColor(color))

TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = 0

It will set the projection overrides for an element in a given view. You’ll need the list of views each element resides in, the list of clouds to be overridden, and a single ARGB color.


#13

It’s Hot Gear. I tried the script you provided and it works like a charm. Thanks!


I couldn’t get it to work with Element.OwnerView tho, so I’am currently restricted to only one type of view, which is sufficient at this time.


#14

My test script was run with OwnerView so I’m not sure what the issue is.


#15

sorry, my bad. I plugged the All Elements of Category directly to the Element.OwnerView and as I can see, I should have done it with the filtered by boolean version. Now it’s really working like a charm.