Can I call dynamo nodes in my custom Python Node?

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!!!

@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]
4 Likes

Thank you!!!

1 Like

@alexischerner Please mark as solved

Hi,
I want to call an excel file in my python script.
Can I access the node ImportExcel or is there a better way to do this?