Assign color to a curve : how?

Hello
I asked a question in Grasshopper forum and i searched a lot but i don’t find an answer.
I create a line with GhPython, how i can assign color to it?

3 Likes

I find a solution

from ghpythonlib.componentbase import executingcomponent as component
import Grasshopper, GhPython
import System
import Rhino as rh
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg


class CurveColor(component):

    def RunScript(self,Crv,RGB):
        self.C = Crv
        self.RGB = RGB
        if not self.C: return
            
    def DrawViewportWires(self,arg):
        if not  self.C: return
        arg.Display.DrawCurve(self.C, self.RGB)

Hello! Isn’t the code finished?

Yes , why?

Sorry, I’m a beginner. Can’t I achieve your effect?

Try this

curve color.gh (5.7 KB)

Thank you! As we wish, it is well realized! It may not work the same way as this calculator! But it’s also great!bb