DisplayConduit on active viewport only


#1

in python i have a DisplayConduit class, with some postdraw etc.

class myOverlay(Rhino.Display.DisplayConduit):
    def PostDrawObjects(self, e):
        e.Display.DrawPoint(...
       

how can i limit the draws to the active view?
And another related question - while i script in pyhton - if the script throws an error while a displayconduit is active, it stays in the viewport till i restart rhino. Is there a way to clear all conduits in one go?
Thanks!


(Dale Fugier) #2

A good approach is to compare e.Viewport.Id with the ID of the viewport you want to be drawing in. If they match, then draw away…


#3

I had the same question… check out the end of this thread for how to remove your previous conduit: List of Registered Display Conduits?

Mark