Change revision cloud color based on "Issued to" parameter

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!

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.

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.

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)

3 Likes

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.

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!

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:

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

I tried this:
2017-09-18_revisions

and this:
2017-09-18_revisions_2

but nothing happened to the revision clouds.

Only when I tried this, the cloud changed color:
2017-09-18_revisions_3
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:

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.

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.

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

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.

Ewan,
I am somewhat new to Python, and I am looking to add to your script. Do you by chance know where I can add to change the linetype of the revision? Also would you be so kind as to tell me what that line(s) of code would be? I am looking at making my revision clouds “dashed” along with turning them red.
Thank you in advance,
Brad

Updating the python code to add this to the GraphicsOverrideSettings created is the way to go.
An additional node/workflow to specifiy the Line Pattern will be required, I have just used the node from the #archi-lab package.

Revised code below.

import clr
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

clr.AddReference("RevitAPI")
import Autodesk

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

listlength = IN[3]
patID=UnwrapElement(IN[4]).Id

elements = []
for i in IN[0]:
	elements.append(UnwrapElement(i))

viewlist = []
for j in IN[2]:
	viewlist.append(UnwrapElement(j))

dsColor = IN[1]
colRed = dsColor.Red
colGreen = dsColor.Green
colBlue = dsColor.Blue
color = Autodesk.Revit.DB.Color(colRed, colGreen, colBlue)

gSettings = Autodesk.Revit.DB.OverrideGraphicSettings()
gSettings.SetProjectionLinePatternId(patID)
gSettings.SetProjectionLineColor(color)

TransactionManager.Instance.EnsureInTransaction(doc)

result = []
for k in listlength:
	try:
		id = elements[k].Id
		viewlist[k].SetElementOverrides(id, gSettings)
		result.append("success")
	except:
		result.append("failure")
	
TransactionManager.Instance.TransactionTaskDone()

OUT = elements, result

Perfect! That is exactly what I needed it to do. I just used the built in revit Line Patterns node. It works just the same. A lot of my users are not in my local office and they are not that familiar with Dynamo so I try to limit the number of external packages they would need to install.
Thanks again!
Brad

Hello Guys,

this script worked perfectly until today - thanks for that! Now we are experiencing some trouble - i hope someone here can help! I see the second color (blue) as wished only in the matrix view - all clouds in the dependent views (that are obviously the very same clouds) will be shown red…

Thanks!

I’m having issues grabbing the “Dependent Views”, so I’m having to open each of those views up & run the Element.OverrideColorInView node from the Code Block Position as the final node. It sucks as there’s a deadline to get them out, but for future references I’d like to get it resolved.

Any Idea how to grab those dependent views too, or to just isolate that selection type?

1 Like