Creating a color legend from View filters

Bonjour à tous,

Je souhaiterai crée un script qui récupère les couleurs de filtres d’une vue spécifique et créé autant de nouvelles zones remplies qu’il y a de filtres et les échelonne dans la légende.
Merci d’avance pour vôtres aide.

Bien cordialement.

Google translation:

Hello everyone,

I would like to create a script that retrieves filter colors from a specific view and creates as many new filled areas as there are filters and arranges them in a legend.
Thank you in advance for your help.

Best regards.

Hi Toufik,

I have a node in the Genius Loci package that retrieves the colors of the filters.
The filledRegion can be created with the name of the filter.

Get%20Color%20of%20filter%20and%20create%20legend%20with%20FilledRegion%202

Get%20Color%20of%20filter%20and%20create%20legend%20with%20FilledRegion%202

6 Likes

Hi Alban,
thank’s for sharing.it’s very helpful for me.

Hi @Alban_de_Chasteigner,

I can´t find the Genius Loci node you are talking (View_Get Color of Filter). I´ve downloaded the latest version of Genious Loci package and some previous versions too.

Could you help me? Could you also share the Dynamo version you are using and the package version also?

Thanks

Hi Jorge,

It’s odd. When I download the package, I find the custom node.

Let me know if you still have an issue.

Hi again Alban,

I´m not capable to see it, I´m not sure if it´s for the Dynamo version, I´m using 1.3.2.

Thanks

I don’t have Dynamo 1.3.2 installed so I can’t reproduce your problem.

Can you look in C:\Users%USERNAME%\AppData\Roaming\Dynamo\Dynamo Revit\1.3\packages\Genius Loci\dyf and check if the custom node is present ?
If so, open it with Dynamo and see if it appears in the library.

If not, you can download the package at https://dynamopackages.com/ and extract the custom node from the zip folder.

Maybe _ is a prohibited character in Dynamo 1.3.2. (in View_Get Color of Filter)

Confirmed, it´s problem of Dynamo 1.3.2.

When I try to open it manually, Dynamo don´t let me open it.

Thanks

3 posts were split to a new topic: Find Python code “FilledRegion.ByCurves in ActiveView”

Hey,
I tried replicating this script to make a small variant on it, but I can’t seem to find the final “FilledRegionColorChange” node you used. Is it from a specific package? I can only find FilledRegion Pattern Change from GeniusLoci, but I don’t think that does the trick (unless I’m using it wrong). I’m on Dynamo 2.0.1 if that makes a difference.

Hi Jonathan,

The node FilledRegionColorChange is in Plissken package.

Thanks!
I think I’ve got it all set up now, but for some reason the ElementTypes.Duplicate is giving me troubles now.
You don’t happen to be familiar with this error message?
afbeelding
Yesterday this part seemed to work fine, so I thought it might have been some problem between the Plissken package and Archi-lab.net, but I uninstalled Plissken to check it out and it doesn’t seem to make a difference.

Hi Jonathan,

You forget the lacing on the nodes. (Longest lacing on ElementTypes.Duplicate node and cross product lacing on Geometry.Translate node).

The FilledRegionColorChange node of Plissken package not working in my language version of Revit, so I created a new one in python that you can find in the latest release of the Genius Loci package.

Create%20legend

Hello!

The only node that I can´t find is “filled.RegionByCurves in ActiveView”. Where can I get it from?

Hi,

You can find the link to the script a few posts above.

I´ve got some problems with the ElementTypes.Duplicate. There is a warning that says: Warning: ElementTypes.Duplicate operation failed. The call is ambiguous between the following methods or properties: ‘Revit.Elements.ElementWrapper.Wrap(Autodesk.Revit.DB.Material, bool)’ and ‘Revit.Elements.ElementWrapper.Wrap(Autodesk.Revit.DB.FamilyInstance, bool)’. Does anyone know how to solve it?

It´s solved. I downloaded the latest version of archi-lab and it works. The problem now is the python script. It comes up a warning saying: IronPythonEvaluator.EvaluateIronPythonScript operation failed. Traceback (most recent call last): File “”, line 52, in Exception: This view does not support detail items creation. Parameter name: viewId. Any idea?

Hello Alban,
I recreated the script it works on the plan views but not in the elevation views? See you a reason for that.
Thank you for your package.
JF

Hello @Alban_de_Chasteigner, I am finding the node ElementTypes.Duplicate very unstable since it works only the first time I run the script, then it generates a warning. As @JorgeFebles suggested I have unistalled archi-lab and reinstalled but the issue remains the same.
Does someone has any updates regarding this script?
Or, are there any other way to create a Legend in a Revit Sheet from Dynamo?

Thanks in advance

Hi Andrea,

There are other nodes to duplicate types in Springs and Clockwork packages that you could try.
Type%20Duplicate

It could be an element binding issue.