Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NXOpen Cycling through text on a drawing sheet

Status
Not open for further replies.

EngProgrammer

Aerospace
Jan 14, 2015
150
Dear Forum,

I am looking for a snippet of code to search through the text on a drawing sheet.

Any ideas?

 
Replies continue below

Recommended for you

You could always cycle through the object tags filtering results and only return those tags of objects that are drafting notes. From there you can reference those tags to what I assume search the contents of the notes.

Code:
'use this to cycle through object tags
[indent]ufs.Obj.CycleObjsInPart[/indent]

'then ask type and subtype
[indent]ufs.Obj.AskTypeAndSubtype[/indent]

'you will be filtering using these
[indent]UFConstants.UF_drafting_entity_type[/indent]
[indent]UFConstants.UF_draft_note_subtype[/indent]
 
Iterating through the part's .Notes collection would be easier than using CycleObjsInPart.

However, I suspect the real question is "how to search through the text on a given drawing sheet".
If this is the case, the following thread may be of interest:
thread561-369358

www.nxjournaling.com
 
Thanks Cowski,

I started to review the code within the suggested thread. It seems like you collect all the notes and labels contained within the displayed part and then cycle through all these notes and labels to find which ones are on certain drawing sheets.

Isn't there a way just to get the notes, labels and dimensions on the current open drawing sheet???

I was thinking of using the following line of code.

Dim sheet As DrawingSheet = workpart.DrawingSheets.CurrentDrawingSheet()

Then when the user in using the app. He/she has to make sure they have a particular drawing sheet current before running the app.

Any suggestions or ideas? The nesting seems backwards, get all the notes, labels and find out which ones are on certain drawing sheets.

Thanks.
 
I see two potential ways to relate the drawing sheet and the notes that it contains.
[ul]
[li]Query the note object to see what sheet it is on.[/li]
[li]Use the sheet view's .AskVisibleObjects method then sort through the objects to find the notes.[/li]
[/ul]

Personally, I'd use the first option to create a way to relate the notes to the drawing sheets. A dictionary object with the key/value pair as the sheet object (key) and list of note objects (value) would allow you to quickly access all of the notes on any given sheet in the file.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor