AddRhinoObjec problem add object new PageView

I´m programming in C# and I have a Surface with a texture and I want to clone the texture inside a closed curve that intersecting with the surface in a new View. I´ve been thinking in diffents options and I´ve trying to do it creating a new page view and create a duplicate of the object in this new page view. I do not know if it is the best option but would appreciate advice if you know a better

For this, I have a List of Curve, I draw a Curve over the surface and I clone the surface in the new PageView, I know how to do it,

Moreover, I want to move the Curve over the surface and To clone the texture when I finish my movement of the curve. I´ve solved this with a button, First I move the Curve and after I push a button and clone it.

My problem is that I want to capture an Event when I finish the movement and To clone automatically without push a button.

I´ve tried with protected override void OnMouseUp(MouseCallbackEventArgs e), but when I move the curve, the curve is selected and I ´ve read that event OnMouseUp is disabled when an object is selected.

My second option is to capture the movement, I´ve used AddRhinoObjec and I can capture it when I finish the movement but when I try to draw in the new PageView(mascara) to clone the new texture it always draw in the main Pageview, I change activeview with RhinoDoc.ActiveDoc.Views.ActiveView = vistaMascara before RhinoDoc,Activedoc.Objects.Add(), but it always add in the main View.

If I move the Curve and after I push a button, in this button I change the ActiveView it draw in the MascaraView, but If I tried to do the same in the AddRhinoObject Event, it always draw it in the main view. this is my problem.

Here my code:

To create a new View.

var pageview = RhinoDoc.ActiveDoc.Views.AddPageView(Constantes.NOMBRE_NUEVA_VISTA_MASCARA_FIGURAS);
           
if (pageview != null)
{        
     pageview.PageWidth = 4000;
     pageview.PageHeight = 5000;

     pageview.SetPageAsActive();
     pageview.Floating = true;

     pageview.ActiveViewport.ZoomExtents();

     RhinoDoc.ActiveDoc.Views.ActiveView = pageview;
     RhinoDoc.ActiveDoc.Views.Redraw();
}

Event when capture the movement

RhinoPageView vistaMascara = GetViewMascara();

vistaMascara.SetPageAsActive();

RhinoDoc.ActiveDoc.Views.ActiveView = vistaMascara;
RhinoDoc.ActiveDoc.Views.Redraw(); 

Guid guidTexture = RhinoDoc.ActiveDoc.Objects.AddBrep(brep, atributs);

I’m struggling trying to figure out why you are (trying to do this). What exactly are you trying to accomplish and why?

Hello @Dale

I have a picture of a real marble stone, and we need to cut and extraxt differents parts of this stone that will join together, for example, stone kitchen( I think it is named countertop), can have 3 or 4 pieces.

The curves of the picture are the different pieces of the countertop, and I would like to see in another window the final result with all the pieces join together, because many stones have a special texture with lots of vein and want to move the curves to prevent these veins.

In the new Window/View I would like to see a preview of the final result of the kitchen before cutting stone.

If you want to view the part in a different window, then creating a new layout with a single detail might be a solution. It makes sense to keep the geometry on model space (instead of moving it to layout space).

I thought about this solution.

I tried this : http://wiki.mcneel.com/developer/rhinocommonsamples/addlayout

But I´m new in View, pageview and detailview and I´m not sure if I´ve understood the functioning of this. When I add a page view “AddPageView”, in this pageView I add a “DetailView”, but in this detail view I have the same objects I have in the others view, it is like a mirror of the others, if I draw a object in the new detailview it´s drawn in all views.

I need a Independent view, because the objects aren´t in the same position in the two windows, I don´t know if this is posible to do it with “detailview” and if it is posible, how to do it.

You might want to spend some time with this information.

http://wiki.mcneel.com/rhino/layouts5