Nevron Forum

Determine if a Shape is in the Drawing Area

https://www.nevron.com/Forum/Topic4260.aspx

By Volvick Derose 1 - Tuesday, October 5, 2010

Assume that some shapes are in the drawing are and none of them is selected. Is there a way to determine if a shape is in the drawing area. By knowing the name of the shape, I couldn't find a way to determine if a shape is already in the drawingview.
By Nevron Support - Wednesday, October 6, 2010

Hi Volvick,

you can check if a shape is in the currently shown area of the view by simply testing if the shape's bounds are within the bounds of the drawing view's viewport. For example:

if (view.Viewport.Bounds.Contains(shape.Bounds))

{

      // The shape is in the currently displayed area of the view

}