×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journaling - Cell select

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)

NX8.5 - NX9 - NX 10 - NX11

RE: Journaling - Cell select

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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

(OP)
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

RE: Journaling - Cell select

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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

(OP)
i will try to do something :) i will post the result

NX8.5 - NX9 - NX 10 - NX11

RE: Journaling - Cell select

(OP)
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

RE: Journaling - Cell select

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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

(OP)
i will try something :)

Thank you

NX8.5 - NX9 - NX 10 - NX11

RE: Journaling - Cell select

(OP)
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

RE: Journaling - Cell select

Can you post the snippet of code where you are trying to get the cell.

Mike Hyde
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

(OP)
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

RE: Journaling - Cell select

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
www.astonmartin.com
NX10.0.3 with TC11.2.1 and Vis 11.2

RE: Journaling - Cell select

(OP)
thank you :) i will give feedback after

NX8.5 - NX9 - NX 10 - NX11

RE: Journaling - Cell select

(OP)
(found this on the forum: https://community.plm.automation.siemens.com/t5/NX...)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources