lklo
Industrial
- Nov 24, 2010
- 226
hi
I'm a little challenged regarding a program I'm doing these weeks....NXOpen API
It's about the special char ∆....
A. I need to be able to set a string(which contains this ∆ (triangle)) in a cell in a tabNote....
I tried in NX8.5...in this case the ∆ is changed to ? or # , when set from journal..
I also tried in NX10....then nothing where set - just an error...see attach pic
I both NX 8.5 and NX 10 - it's possible to output a ∆ in a msgbox from a journal...but not in a tabNote cell....
It's also possible to manuel paste a ∆ into a cell in a tabNote.....
here is small code...(remember "name_of_tabNote")
B. I also tried to use a ∆ in Blockstyler..
In NX 8.5 when the ∆ is used in a text in a Radio button > output in dialog is a #
But in NX 10 this works as expected...see pic...
I will look forward, if anyone have some suggestions...
lklo
I'm a little challenged regarding a program I'm doing these weeks....NXOpen API
It's about the special char ∆....
A. I need to be able to set a string(which contains this ∆ (triangle)) in a cell in a tabNote....
I tried in NX8.5...in this case the ∆ is changed to ? or # , when set from journal..
I also tried in NX10....then nothing where set - just an error...see attach pic
I both NX 8.5 and NX 10 - it's possible to output a ∆ in a msgbox from a journal...but not in a tabNote cell....
It's also possible to manuel paste a ∆ into a cell in a tabNote.....
here is small code...(remember "name_of_tabNote")
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module test_my_triangle
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Sub Main()
Dim theTabNoteTag As Tag
theTabNoteTag = Find_TabNote_of_Given_Name("name_of_tabNote")
If theTabNoteTag = Tag.Null Then Return
'===========================================================================
' test A
msgbox("Δ") ' works
' test B
Set_theTabnote_Cell_Text(theTabNoteTag, 1, 0, "∆") 'do not work
' test C
Set_theTabnote_Cell_Text(theTabNoteTag, 2, 0, "Δ") 'do not work
'===========================================================================
End Sub
Public Function Find_TabNote_of_Given_Name(ByVal name As String) As Tag
Dim tempTag As Tag = Tag.Null
Dim tabNoteTag As Tag = Tag.Null
Dim theDispPart As Part = theSession.Parts.Display
Dim type, subType As Integer
Do
theUfSession.Obj.CycleByNameAndType(theDispPart.Tag, name, UFConstants.UF_tabular_note_type, False, tempTag)
If tempTag = NXOpen.Tag.Null Then
Continue Do
End If
theUfSession.Obj.AskTypeAndSubtype(tempTag, type, subType)
If subType = UFConstants.UF_tabular_note_section_subtype Then
theUfSession.Tabnot.AskTabularNoteOfSection(tempTag, tabNoteTag)
Return tabNoteTag
End If
Loop Until tempTag = NXOpen.Tag.Null ' No more tabular notes are found
Return Tag.Null
End Function
Public Sub Set_theTabnote_Cell_Text(ByVal tabular_note As Tag, ByVal rowIndex As Integer, _
ByVal colIndex As Integer, ByVal newText As String)
Dim row As NXOpen.Tag
Dim col As NXOpen.Tag
Dim cell As NXOpen.Tag
theUfSession.Tabnot.AskNthRow(tabular_note, rowIndex, row)
theUfSession.Tabnot.AskNthColumn(tabular_note, colIndex, col)
theUfSession.Tabnot.AskCellAtRowCol(row, col, cell)
theUfSession.Tabnot.SetCellText(cell, newText)
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
B. I also tried to use a ∆ in Blockstyler..
In NX 8.5 when the ∆ is used in a text in a Radio button > output in dialog is a #
But in NX 10 this works as expected...see pic...
I will look forward, if anyone have some suggestions...
lklo