The following journal will inspect the current work part for any drafting dimensions that have had their value overridden by a manual text entry. Any such dimensions will be highlighted and the sheet name, view name, and dimension text will be output to the listing window.
The journal was written on and tested with NX 7.5
'NXJournaling.com 'tested with NX 7.5 'May 31, 2012 'When run, the journal will highlight all dimensions in the part that have manually entered text. 'The listing window will report the dimension text, view, and sheet for each dimension 'with manually entered text. Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Module Report_Dimensions_manual_text Sub Main() Dim theSession As Session = Session.GetSession() Dim ufs As UFSession = UFSession.GetUFSession() Dim workPart As Part = theSession.Parts.Work Dim displayPart As Part = theSession.Parts.Display Dim lw As ListingWindow = theSession.ListingWindow Dim mpi(99) As Integer Dim mpr(69) As Double Dim radius_value As String Dim diameter_value As String Dim manualTextCount As Integer = 0 Dim dictionary As New Collections.Generic.Dictionary(Of String, String) Dim viewList() As View Dim text1() As String Dim text2() As String lw.Open() For Each sheet As Drawings.DrawingSheet In workPart.DrawingSheets viewList = sheet.GetDraftingViews For Each myView As View In viewList dictionary.Add(myView.Name, sheet.Name) Next Next Dim partDimensions() As Annotations.Dimension partDimensions = workPart.Dimensions.ToArray If partDimensions.Length > 0 Then For Each partDimension As Annotations.Dimension In partDimensions ufs.Drf.AskObjectPreferences(partDimension.Tag, mpi, mpr, radius_value, diameter_value) If mpi(7) = 3 OrElse mpi(7) = 4 Then 'dimension has manual text partDimension.Highlight() lw.WriteLine("Sheet: " & dictionary(partDimension.GetAssociativity(1).ObjectView.Name)) lw.WriteLine("View: " & partDimension.GetAssociativity(1).ObjectView.Name) partDimension.GetDimensionText(text1, text2) Dim j As Integer lw.WriteLine("Dimension Text: ") For j = text1.GetLowerBound(0) To text1.GetUpperBound(0) lw.WriteLine(" " & text1(j)) Next manualTextCount += 1 lw.WriteLine("") End If Next If manualTextCount > 0 Then MsgBox(manualTextCount & " dimensions have manual text and have been highlighted") Else MsgBox("There are no dimensions with manual text in the part") End If Else MsgBox("There are no dimensions in the work part") End If lw.Close() End Sub Public Function GetUnloadOption(ByVal dummy As String) As Integer 'Unloads the image when the NX session terminates GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination End Function End Module

Comments
some problems with multiple sheets
Hi nxjournaling,
looking in the details on this function I have the problem this is on scope of the entire drawing part.
I cannot set the scope on the sheet for example if I have more than one sheet in my part. To cut it short
How can I find only the manual dimensions of the given drawingsheet ( or view )?
thanks in advance
re: multiple sheets
I don't know of a way to limit the journal selection to dimensions on a given sheet. However, you can determine the sheet that a given dimension resides on. With this information, you can process only the dimensions that you are interested in.
The following code, by Amy Webster, is taken from GTAC document: nx_api4937.
not clear how to continue
thank you nx journaling on reply,
It is not really clear what you try to explain.
Dim partDimensions() As Annotations.Dimension
partDimensions = workPart.Dimensions.ToArray
If partDimensions.Length > 0 Then
For Each partDimension As Annotations.Dimension In partDimensions
-> something like sheet dimensions to array but this will not work ->I'm looking for.
may you can give me some more advice
thanks in advance
re: filtering dimensions by sheet
Loop through the entire dimension collection, pass each dimension object to the function given above; it will return which drawing sheet the dimension resides on. When you find a dimension on the sheet you are interested in, perform whatever processing you need to do to that dimension object.
Alternately, you can create your own collection (array, list, stack, queue, etc) for each drawing sheet. Loop through the entire dimension collection (as above) and add them to the correct "sheet collection" that you have created based on which drawing sheet it resides on.
some problem with Highlight
Hello
I tested it with NX 9.0.3. It works.
But, there is a Problem with highlighting. You can't de-highlighting dimension.
is there a possibility that mass colored differently? (without Highlight)
THX
BK
NX9
re: problem with highlight
After running the journal, any leftover highlighting can be removed by running the part cleanup utility (use the 'remove extraneous highlighting' option). To remove the highlighting entirely from the journal either comment out or remove the following line:
re: problem with highlight
Thank you a lot.
But is there a function, how can I change the Dimensions with Manual Text automatically in other color (with this code)
in other words, instead of highlighting, recolor Dimensions with Manual Text.
THX
BK
NX9
re: change color of dimension with manual text
The code below will change the color of the dimension with manual text rather than highlighting it. The code is currently set to use color 84 for dimensions with manual text; change this value as desired before running the journal.
THX
thank you very much
it's works very fine, I tested it on NX9.0.3 MP3 and NX10
thanks a lot
NX9