Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete entities inside a boundry (rectangle or square) in journal

Status
Not open for further replies.

lklo

Industrial
Joined
Nov 24, 2010
Messages
226
Location
DK
Hi -

Does anyone know if it should be possible to find notes inside a "rectangle" defined by two set of coordinates from a journal.

Let's say on a drawingsheet notes that resides "inside" the coordinates X200,Y200 and X300,Y400 can by collected into an array.

My task is to do automate deleting of only some notes one sheet - the area where they residens are known.

lklo
 
I have some similar code that I used to extract the title from old drawings. The variables titleLowLeft and titleUpRight in the code below are of type Point3D; they are used to define the boundary of the drawing title area in the title block.

Here's the relevant snippet:
Code:
For Each tempNote As Annotations.Note In workPart.Notes

    'test to see if the note is in the title block "drawing title" box
    If tempNote.AnnotationOrigin.X < titleLowLeft.X Then
        Continue For
    End If

    If tempNote.AnnotationOrigin.Y < titleLowLeft.Y Then
        Continue For
    End If

    If tempNote.AnnotationOrigin.X > titleUpRight.X Then
        Continue For
    End If

    If tempNote.AnnotationOrigin.Y > titleUpRight.Y Then
        Continue For
    End If

    'if we get here, the note is in the box
    'code to process note

Next

www.nxjournaling.com
 
Cowski -

It is an ingenious way to "define" the Square. Simpel and cleane solution.

Thank you very much.

( I have written an NXOpen API which fully automaticly replace our Tilteblocks in all sheets in our dwg parts. )

(But we also have some old dwg part's which contains patterns - I have choosen to divide theese task's in two programs.
And after the sequence where I delete the patterns - there are some notes left that needed to be deleted.
I can do this with the snippet you provided me. The coordinates can be predefined after I have asked for the sheet size )

so everything is Ok.

lklo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top