Can I call dynamo nodes in my custom Python Node?

python
revit
dynamo

#1

Hello!

I was wondering how I can call a specific existing Dynamo node within my custom Python node. Specifically I want to call Color.ByARGB and Element.OverrideColorInView.

I’m writing a python script because I have a list of RGB values, and I want to set every element of a specific family to the corresponding unique color based on the RGB values. So I want to write a python node which cycles through each element of each list and sets the RGB values accordingly. I thought of a way to do it…if I can call the existing node functions. Is this possible? If not, is there a better way to do what I am trying to accomplish? Thank you so much!!!


#2

@alexischerner

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

clr.AddReference('DSCoreNodes') 
import DSCore
from DSCore import *

dataEnteringNode = IN
col=DSCore.Color.ByARGB(255, 200, 200, 200);

IN[0].OverrideColorInView(col);

OUT = IN[0]

#3

Thank you!!!


#4

@alexischerner Please mark as solved