Override Element Graphics - Halftone

Does anyone know of a way to override the element halftone checkbox in Dynamo? I’ve found ways to override the color.

Hi @Shane_Evens

Are you looking for this?

1 Like

That functionality is coming to Dynamo in next release…https://github.com/DynamoDS/DynamoRevit/pull/1378

In the meantime i bet @Kulkul wasn’t just showing off and will share the code. :slight_smile:

1 Like

Hi @Konrad_K_Sobon

Off course i will share the code :slight_smile:. I was just making sure if the user is looking for the right answer :wink:

Yes, that is exactly what I was looking for :slight_smile:

@Shane_Evens Here is the dyn file Override Element halftone.dyn (8.5 KB)
Don’t forget to mark the post as solved. Thanks :slight_smile:


Thanks for posting the code for override graphics! One question you or someone may be able to help with, is there a way to error check the input going into the final 3-input python script? I am sending a list of elements to your code and if the selection is an empty list, it freezes up.

I’m relatively new to Dynamo and my current method of using an if statement with List.IsEmpty node to filter the input does not seem to work on this one and I’m not sure what to pass to it if it’s empty anyway.

Thanks again!

You need to use “List.Clean” with preserve indices set to false to remove empty list before connecting to python.

That would work for lists of lists, but the issue I will often run into is that the model will have no elements at all to grayscale at times, so there are no items left in the list at all. In the image below, there is still an empty list when you run List.Clean on the empty list.

This portion of my dynamo project is looking at objects and will grayscale override objects in a drafting view associated to them if they are not on New Construction. It needs to make all in the list halftone or do nothing if an empty list is passed to it. Here is a screenshot of the lockup when I select a family type not present in the Revit model.

Thanks again!

@Shane_Evens Why don’t you use Category node and filter the types which are empty.

The problem seems to be that there may not be any types that are not empty.

This works great the way it is if I have at least one family created on existing phase. The issue I am running into is that this same dynamo script will often be executed in a project with all new construction, so I frequently have nothing (resulting empty list) to pass to the Python portion you provided. This portion of the code runs within a large dynamo script that does a number of other things depending on their parameters, so it cannot simply be run only on projects that have families on existing phase.


I’ve not looked at the code, but could you not just handle null inputs in the Python node and skip the empties?