Displaypipeline and BlockManager previews

What’s the best to determine whether a viewport is not part of the standard Rhino viewports and thus should be skipped by my custom previews? For example the BlockManager:

The block manager’s preview is generated from new viewport, not one of the standard, existing viewports. Looks like your custom conduit is somehow appearing in this preview?

Yes it is, the display pipeline events are clearly raised on these viewports. Is there a viewport property I can look at to determine this, or do I need to iterate over all viewports in a RhinoDoc to figure out whether it’s part of the ‘standard’ set?

As a side-note, would it make more sense to switch to Top/Front/Right view by default if the boundingbox of the block is degenerate in one direction? I suspect a lot of blocks are 2D drafting elements, and looking at them in perspective is awkward.

I’ve logged a youtrack item for this.

http://mcneel.myjetbrains.com/youtrack/issue/RH-29514

The block preview generation code will generate a preview image of any standard view. Right-click on the control and you will see what I mean.

The preview modes could be more discoverable, or even automatic as you suggest. Feel free to add a youtrack item for this if you think its important.

A “true” Rhino viewport comes from a CRhinoView…any viewport that doesn’t use a CRhinoView is most likely going to be some kind of off-screen drawing buffer, or some other kind of window. Therefore, your conduit code could just check to see if “m_pView == NULL” and not execute… I’m not sure how that translates to .NET or common code…but I’m sure there’s a way to get and/or determine if the conduit’s m_pView pointer is NULL.

That’ll also work for all layout cases?

I’m pretty sure it will. All layouts use a view and all details draw into the same view. So I believe any conduit running inside a detail or layout will have its m_pView set accordingly.

Yeah that seems to do the trick. Putting the code below in PostDrawObjects omits my gunk from Block previews:

if (e.Viewport.ParentView == null) return;