Journaling - Cell select
Journaling - Cell select
(OP)
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)
i can select the tabular note but cant only the cell.
(im using VB)
NX8.5 - NX9 - NX 10 - NX11





RE: Journaling - Cell select
CODE
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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
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
RE: Journaling - Cell select
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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
NX8.5 - NX9 - NX 10 - NX11
RE: Journaling - Cell select
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
RE: Journaling - Cell select
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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
Thank you
NX8.5 - NX9 - NX 10 - NX11
RE: Journaling - Cell select
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
RE: Journaling - Cell select
Mike Hyde
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
im trying to put all together yet, only the "cell" thing is started the others are on standby till i can pass thru the select cell
(i can send the dlx if u want )
NX8.5 - NX9 - NX 10 - NX11
RE: Journaling - Cell select
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 IfYou 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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
NX8.5 - NX9 - NX 10 - NX11
RE: Journaling - Cell select
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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2
RE: Journaling - Cell select
NX8.5 - NX9 - NX 10 - NX11
RE: Journaling - Cell select
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