Tags same color as pipes/Ducts

Hey,

We are trying a new challenge and have dived into Dynamo.

We are trying to create a Graphs to give at the tubes and channels the tags the same colour as the tube/channel.
We find the number of tags and tags types
But we get stuck at the Python node?
Can anyone help us forward?

Link - Unique Download Link | WeTransfer

Load the Python Standard and DesignScript Libraries

import sys
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

Place your code below this line

systemtype=UnwrapElement(IN[0])
listout=

for x in systemtype:
listout.append(x.LineColor.Red)
listout.append(x.LineColor.Green)
listout.append(x.LineColor.Bleu)

Assign your output to the OUT variable.

OUT = listout

Danny

We can’t really comment on anything if you don’t share the python code. Post it here (as preformatted text </>) and we should be able to start helping.

Load the Python Standard and DesignScript Libraries

import sys
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

Place your code below this line

systemtype=UnwrapElement(IN[0])
listout=

for x in systemtype:
listout.append(x.LineColor.Red)
listout.append(x.LineColor.Green)
listout.append(x.LineColor.Bleu)

Assign your output to the OUT variable.

OUT = listout

HI genius loci have a node for get your duct/pipes systemtype graphic properties, but only if controlled that way…if controlled by filter then its another situation for get color…for color tags i would override them in views…with element override in views from genius loci or probably create a tag for every system

As I mentioned, always be sure to paste your code as preformatted text so that it retains the formatting.
image

The issue with your code is that you’re providing just a list of strings, rather than the actual line type.

As @sovitek mentions above, the color of the element depends on a number of things and getting that color becomes an exercise in visual overrides. If you know for sure that the color is just controlled by line type, then you’re set. However, pipes and ducts are typically controlled by system type.