Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Journaling - Cell select

Status
Not open for further replies.

vegetagaru

Computer
Jan 14, 2015
134
anyone have any trick to select a cell within a tabular note using journaling ?

i can select the tabular note but cant only the cell.

(im using VB)

NX8.5 - NX9 - NX 10 - NX11
 
Replies continue below

Recommended for you

This is the code that I use:-

Code:
 ufs.Tabnot.AskTabularNoteOfSection(note.Tag, tabular_note_tag)
ufs.Tabnot.AskNthRow(tabular_note_tag, 3, row3_tag)
ufs.Tabnot.AskNthColumn(tabular_note_tag, 3, col3_tag)
ufs.Tabnot.AskCellAtRowCol(row3_tag, col3_tag, celltag)
ufs.Tabnot.AskCellText(celltag, celltext)

You need to get the tag of the tabular note, then the tag of the column and the row, then the tag of the cell. Then you are able to get the text from the cell.

Use SetCellText to insert a value into the cell.

Mike Hyde
NX10.0.3 with TC11.2.1 and Vis 11.2
 
trying to get it working, im using a DLX aswell
Code:
 Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
        Try

            If block Is selection01 Then
ufs.Tabnot.AskTabularNoteOfSection(note.Tag, tabular_note_tag)
ufs.Tabnot.AskNthRow(tabular_note_tag, 3, row3_tag)
ufs.Tabnot.AskNthColumn(tabular_note_tag, 3, col3_tag)
ufs.Tabnot.AskCellAtRowCol(row3_tag, col3_tag, celltag)
ufs.Tabnot.AskCellText(celltag, celltext) 
elseif...

i was trying also other way (dunno if it works with type / subtype)

Code:
 Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
        Try

            If block Is selection01 Then
 selobj = theUI.SelectionManager.GetSelectedObject(selection01)
 
      selection01=ufs.Obj.AskTypeAndSubtype(selobj.Tag, type, subtype)


NX8.5 - NX9 - NX 10 - NX11
 
You can use type/subtype to filter your selection:-
type = UFConstants.UF_tabular_note_type And subtype = UFConstants.UF_tabular_note_section_subtype

The variable 'note' will need to be defined as Annotations.TableSection


Mike Hyde
NX10.0.3 with TC11.2.1 and Vis 11.2
 
i will try to do something :) i will post the result



NX8.5 - NX9 - NX 10 - NX11
 
Mike im trying to work with your code:
Code:
            If block Is selection01 Then
                Dim ufs As UFSession = UFSession.GetUFSession

                ufs.Tabnot.AskTabularNoteOfSection(note.Tag, tabular_note_tag)
                ufs.Tabnot.AskNthRow(tabular_note_tag, 3, row3_tag)
                ufs.Tabnot.AskNthColumn(tabular_note_tag, 3, col3_tag)
                selectrion01 = ufs.Tabnot.AskCellAtRowCol(row3_tag, col3_tag, celltag)

i will need to declare 'note' as Annotations.TableSection, and
tabular_note_tag, row3_tag and col3_tag as integer right or "As NXOpen.Tag" ?

im a bit noob on journaling sorry

NX8.5 - NX9 - NX 10 - NX11
 
You will need an Imports statement:-
Imports NXOpen.Annotations

note will need to be defined
Dim note As Annotations.TableSection

All the tag variables will need to be defined
Dim row3_tag As NXOpen.Tag

Mike Hyde
NX10.0.3 with TC11.2.1 and Vis 11.2
 
i will try something :)

Thank you

NX8.5 - NX9 - NX 10 - NX11
 
is still selectin the whole tabular note instead just the cell :( maybe im doing something wrong i will try a lit bit more then post feedback

btw the declarations is giving-me error:"Severity Code Description Project File Line Suppression State
Warning BC42104 Variable 'note' is used before it has been assigned a value. A null reference exception could result at runtime.
"

NX8.5 - NX9 - NX 10 - NX11
 
Try this

Code:
If block Is selection01 Then
                Dim ufs As UFSession = UFSession.GetUFSession
                Dim note As Annotations.TableSection
                Dim row3_tag As NXOpen.Tag
                Dim tabular_note_tag As NXOpen.Tag
                Dim col3_tag As NXOpen.Tag
                Dim celltag As NXOpen.Tag
                Dim type As Integer
                Dim subtype As Integer

                ufs.Obj.AskTypeAndSubtype(selection01.Tag, type, subtype)
                If type = UFConstants.UF_tabular_note_type And subtype = UFConstants.UF_tabular_note_section_subtype Then
                    note = NXObjectManager.Get(selection01.Tag)

                    ufs.Tabnot.AskTabularNoteOfSection(note.Tag, tabular_note_tag)
                    ufs.Tabnot.AskNthRow(tabular_note_tag, 3, row3_tag)
                    ufs.Tabnot.AskNthColumn(tabular_note_tag, 3, col3_tag)
                    ufs.Tabnot.AskCellAtRowCol(row3_tag, col3_tag, celltag)
                End If

You will need to add this line at the beginning of your code:-
Imports NXOpen.Utilities

The issue was that 'note' was not being defined as anything. I added in a check that a tabular note had been selected but you may wish to remove this.



Mike Hyde
NX10.0.3 with TC11.2.1 and Vis 11.2
 
selects all table instead of cell still, maybe the tabular note check goes in conflit ? because what i want is just the cell

NX8.5 - NX9 - NX 10 - NX11
 
I see what you are trying to achieve now. The code I gave you would allow you to select the tabular note and then you could get the contents of a particular cell whereas you are trying to select the actual cell.

What you need is a selection mask - this article explains them nicely but I haven't used them with Block Styler. You would need to set the subtype to UFConstants.UF_tabular_note_cell_subtype. To get the cell contents you would use ufs.Tabnot.AskCellText(celltag, celltext).

Mike Hyde
NX10.0.3 with TC11.2.1 and Vis 11.2
 
thank you :) i will give feedback after

NX8.5 - NX9 - NX 10 - NX11
 
(found this on the forum: maybe something like this:
Code:
                Dim oSelectionMask(0) As Selection.MaskTriple

                With oSelectionMask(0)
                    .Type = UFConstants.UF_tabular_note_type
                    .Subtype = UFConstants.UF_tabular_note_cell_subtype

                End With
                selection01.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, oSelectionMask)

NX8.5 - NX9 - NX 10 - NX11
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor