OK, so I’m trying to override the DrawViewportWires in a C# script component, but it seems the method is never called.
Are there any render modes, settings or any other explicit preconditions that needs to be met before the DrawViewportWires is actually called?
I.m calling “RhinoApp.WriteLine(“Custom Drawing…”);” from the DrawViewportWires method to debug if the method is called, but no such text shows in the command history window.
The relevant code (I am setting the data lists in the RunScript method):
Does your C# component have any inputs or outputs? I noticed that if the component has no drawable parameters it will never even attempt to draw itself.
Nah, It just broke while I’m in the middle of a heavy refactoring. In a minute or two, or a hundred, I’ll be back up running.
// Rolf
Edit: OK, @DavidRutten, now I’m back again after doing some refactoring. The component now compiles, but still nothing is drawn by the draw method (so I used CustomPreview for now, Disable them and then nothing at all is drawn).
The files. The main script is as simple as heart’s desire, so I have no clue about what could be the problem:
You’ve switched the preview off on your component. Are you sure that’s not the problem?
Yeah, that definitely is the problem. If I enable the preview your chain starts showing up. I changed your lines from 1-pixel black lines to 5-pixel pink ones, and they’re right there:
If you don’t want your output parameters to also show their preview, then you must hide them individually, but disabling the preview for the whole component does exactly what it claims on the tin.
foreach (var param in Component.Params.Output)
{
IGH_PreviewObject prv = param as IGH_PreviewObject;
if (prv != null)
prv.Hidden = true;
}