Select and delete area/region on a sheet (idw) by points

Select and delete area/region on a sheet (idw) by points

Anonymous
Not applicable
462 Views
3 Replies
Message 1 of 4

Select and delete area/region on a sheet (idw) by points

Anonymous
Not applicable

Hi,

      sorry for my english. In a vb.net plug-in, I need to delete everything in an area of a sheet (idw).  I know the coordinates of the two points of this area.  How can I select this particular area and delete everythings?

Thanks in advance.

                          Angelo.

essetiprogetti_0-1590667624036.png

 

0 Likes
463 Views
3 Replies
Replies (3)
Message 2 of 4

JelteDeJong
Mentor
Mentor

if you want to select things like you would do with mouse clicks then i would not know how. But it looks like you are trying to delete sketched symbols. That i would do with the following code. (Also other things could be delete in a similar way)

Dim doc As DrawingDocument = ThisDoc.Document
Dim sheet As Sheet = doc.ActiveSheet

Dim p1 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(10, 10)
Dim p2 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(20, 20)

For Each ss As SketchedSymbol In sheet.SketchedSymbols
    Dim ssp As Point2d = ss.Position
    If (p1.X < ssp.X And ssp.X < p2.X And p1.Y < ssp.Y And ssp.Y < p2.Y) Then
        ss.Delete()
    End If
Next

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 4

Anonymous
Not applicable

Thanks JelteDeJong,
                                      It helped me to start. It would also be interesting to understand how to erase everything that is contained in the area, not just the sketchedsymbols (texts, dimensions, views, etc).
Thanks a lot anyway.
                                      Angelo

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

There is a Sample Program in the online API documentation that goes over how to do Window Selection, but it is for VBA, instead of iLogic.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes