Updating a mesh outline

Question

I’m trying to get a mesh outline from a specific viewport. I’m coming across a problem. How do I make GH give me a mesh outline from
mesh_outline.gh (166.7 KB)
the named view I’m asking for.

Context

Regardless of the value I give to view (MeshOutline(object_ids, view=None)) I get the currently active viewport’s outline.

image

It should be updating the outline when the view name changes. If I move the viewport, it does update when I change the view name, but not how I expect it to.

Here’s the code:

import rhinoscriptsyntax as rs
from scriptcontext import doc

if use_active:
    view_name = doc.Views.ActiveView.ActiveViewport.Name

the_view_we_want = None
for view in doc.Views:
    if view.ActiveViewport.Name == view_name:
        print "using {}".format(view.ActiveViewport.Name)
        the_view_we_want == view

a = rs.MeshOutline(my_mesh, view=the_view_we_want)

Refs

Nathan ‘jesterKing’ Letwory’s answer was very helpful in getting this far.

I was hugely overcomplicating things, it’s fine with just

import rhinoscriptsyntax as rs

a = rs.MeshOutline(my_mesh, view=view_name)

Thanks to Adrian for pointing that out

Hi Ben, I recently found your script for meshoutline and it solved a problem I have had for some time.However, in rhino 8 the component has “OLD” on it even though it works fine… So I tried to copy the script in the python3 component and it doesn’t work…do I have to add extra lines in Python3 ?