Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

Replacing Text In A Table Cell

$
0
0

Hi All,

I am new to the NX journal and I recorded a journal that replaces text in one of the table cell in the title blocks on my drawing.

I figured that because of the selection stickiness, I can't use it on other drawings.

My initial thought was to specify the location of the cell with other method to replace the "FindObject" but I couldn't find instructions on how to do it.

Can someone help me with removing the selection stickiness or point me to the correct direction?

I am working with NX 12. Here is the recorded code. Thanks!

 
Imports System
Imports NXOpen
 
Module NXJournal
Sub Main (ByVal args() As String) 
 
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
 
Dim displayPart As NXOpen.Part = theSession.Parts.Display
 
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Edit Cell")
 
Dim table1 As NXOpen.Annotations.Table = CType(workPart.Annotations.Tables.FindObject("HANDLE R-9610"), NXOpen.Annotations.Table)
 
Dim displayableObject1 As NXOpen.DisplayableObject = CType(workPart.FindObject("HANDLE R-9508"), NXOpen.DisplayableObject)
 
table1.EditCellText(displayableObject1, "NA")
 
' ----------------------------------------------
'   Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
 
End Sub
End Module
<code>

Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>