Python component is visible when disabled

Hey guys. I have a question and I didn’t manage to solve it. Maybe someone has an idea on how to do this.

I created a gh python component and when it’s disabled like in the photo I am uploading, you can still see the geometry in Rhino.

If anyone knows how to make it completely invisible and can help me I would really appreciate it :slight_smile:

PS. I am using the Rhino.Display.DisplayPipeline.DrawHatch to make it visible

I suppose its still visible because you baked it? I can see you have a bake option in your component, maybe if you set it to False? Also you can upload the file so we can have a better look.

No even if I set it to False it’s still visible in Rhino but not baked.

def DrawViewportWires(self,arg):

        hatch = rg.Hatch.Create(self.g,self.h,math.radians(self.r),self.s)

        for i in hatch:

can you upload the gh file? (9.6 KB)

Yeah you’re right. However i found that if you disable the input geometry(curves) or disable preview of your py component would do the work.

Yes I know… I was just wandering If there is a a way to solve it in the code. Thank you though for checking it out

you need to add if ghenv.Component.Locked: return to DrawViewportWires. (9.5 KB)

1 Like

Thaaanks a lot!! It worked!