Perspective View disappears with c# component

This has happened before and I never managed to fix the problem. Just moved on. Now the issue has raised its ugly head again. I have a very long and involved C# Rhinocommon component to optimize acoustic reflections off of surfaces. The code does a lot of things but it never touches the display or anything associated with the Display namespace. (At least not that I know of.) But, for some reason, it turns off any and all perspective views. I can see things in Top or Side views but not in Perspective. The really annoying thing is that it’s inconsistent. The component works in one Grasshopper file (i.e. you can see Perspective views) but not in another.

Does anyone know some wiz-bang ways to recover the Perspective view once my C# code has (somehow) turned it off? I’ve tried the suggestions that I’ve found on line. Apparently the Rhino command “4View” is supposed to reset things but that hasn’t helped. I’ve tried resetting all my Grasshopper>Display options as well.

Any help will be greatly appreciated.

Thanks in advance.

John O’Keefe.

Hi John - does the routine involve creating objects way off in the distance?

-Pascal

It might. The code perturbs a collection of points then creates surfaces. Sometimes the points are found by intersections and those can go off to crazy places. But, now that I think of it, the bug is happening even before I perturb the points.

P.S. I forgot to mention. When I turn the component off, the Perspective view returns. Then when I “Enable” the component, Perspective disappears.

JOK

Hi John - when Perspective disappears. what do the camera coordinates for that viewport look like?

-Pascal

Good question Pascal. I checked into it and, unfortunately, the camera position and target do not change when I turn the component on (i.e. Perspective invisible) or off (Perspective visible). But here’s something. I can see the outlines of surfaces created on the Grasshopper pallet when I grab them with my mouse. Perhaps it’s something in Grasshopper and not Rhino?

JOK

Two steps forward, one step back.

The Grasshopper file where all this is happening is rather large. It’s gone through several versions and I was thinking that perhaps it had gathered some garbage along the way.

So I started a new file and, little by little, started to copy and paste things from the old (presumably contaminated) file. Now I can see the Perspective views but, for some strange reason, when I grab on to, say, a point in my Grasshopper file, it disappears on the Rhino view. But not in the Perspective view. The points will light up in Perspective view but disappear in 2D named views. So there’s something funny going on between the Grasshopper to Rhino pipeline (something I know nothing about).

For now, my problem has been solved. Or should I say, the problem has been averted. But if anyone has any ideas, please feel free to contribute.

And, Pascal, thanks for your help.

JOK

Hi John - probably best if you can send as small/simple a version of the file that shows the problem to tech@mcneel.com, with a link back to this topic in your comments. Then there’s a chance we can see it in action and find out what is going on.

-Pascal