bongoman
Mechanical
- Sep 14, 2006
- 78
Hi All,
I have a VB program that writes strings to an NX drawing sheet (Date, part name etc.). It works great in NX9 and earlier but in NX10 it puts the word (null) above each string that is written to the drawing sheets. Below is a bit of the code doing the writing.
example:
(null)
12-02-15
' ----------- Sheet 1 --------------------------
workPart.Layers.WorkLayer = 150
drawingSheet1 = CType(workPart.DrawingSheets.FindObject("DRAWING1"), Drawings.DrawingSheet)
drawingSheet1.Open()
Dim letteringPreferences1 As LetteringPreferences
letteringPreferences1 = theSession.Parts.Work.Annotations.Preferences.GetLetteringPreferences()
Dim userSymbolPreferences1 As UserSymbolPreferences
userSymbolPreferences1 = theSession.Parts.Work.Annotations.NewUserSymbolPreferences(UserSymbolPreferences.SizeType.ScaleAspectRatio, 1, 1)
Dim Annotations_Lettering1 As Annotations.Lettering
Annotations_Lettering1.size = .125
Annotations_Lettering1.CharacterSpaceFactor = .8
Annotations_Lettering1.AspectRatio = .8
letteringPreferences1.Angle = 0
Annotations_Lettering1.LineSpaceFactor = 1
Annotations_Lettering1.cfw.color = 181
Annotations_Lettering1.cfw.font = 1
Annotations_Lettering1.cfw.width = Annotations.LineWidth.Thin
letteringPreferences1.SetGeneralText(Annotations_Lettering1)
theSession.Parts.Work.Annotations.Preferences.SetLetteringPreferences(letteringPreferences1)
Dim stringArray1(1) As String
stringArray1(1) = mydate
Dim point3d1 As Point3d = New Point3d(4.3, 6.59, 0)
Dim note1 As Note
note1 = theSession.Parts.Work.Annotations.CreateNote(stringArray1, point3d1, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Dim stringArray2(1) As String
stringArray2(1) = UCase(Aline1)
Dim point3d2 As Point3d = New Point3d(1.7, 7.8, 0)
Dim note2 As Note
note2 = theSession.Parts.Work.Annotations.CreateNote(stringArray2, point3d2, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Dim stringArray3(1) As String
stringArray3(1) = Tapeno
Dim point3d3 As Point3d = New Point3d(4.33, 5.65, 0)
Dim note3 As Note
note3 = theSession.Parts.Work.Annotations.CreateNote(stringArray3, point3d3, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Any help would be greatly appreciated.
Regards,
Rick D
Win7 64 bit w/NX9.0.3.4 MP9 and NX10.0.2
Vericut 7.4
I have a VB program that writes strings to an NX drawing sheet (Date, part name etc.). It works great in NX9 and earlier but in NX10 it puts the word (null) above each string that is written to the drawing sheets. Below is a bit of the code doing the writing.
example:
(null)
12-02-15
' ----------- Sheet 1 --------------------------
workPart.Layers.WorkLayer = 150
drawingSheet1 = CType(workPart.DrawingSheets.FindObject("DRAWING1"), Drawings.DrawingSheet)
drawingSheet1.Open()
Dim letteringPreferences1 As LetteringPreferences
letteringPreferences1 = theSession.Parts.Work.Annotations.Preferences.GetLetteringPreferences()
Dim userSymbolPreferences1 As UserSymbolPreferences
userSymbolPreferences1 = theSession.Parts.Work.Annotations.NewUserSymbolPreferences(UserSymbolPreferences.SizeType.ScaleAspectRatio, 1, 1)
Dim Annotations_Lettering1 As Annotations.Lettering
Annotations_Lettering1.size = .125
Annotations_Lettering1.CharacterSpaceFactor = .8
Annotations_Lettering1.AspectRatio = .8
letteringPreferences1.Angle = 0
Annotations_Lettering1.LineSpaceFactor = 1
Annotations_Lettering1.cfw.color = 181
Annotations_Lettering1.cfw.font = 1
Annotations_Lettering1.cfw.width = Annotations.LineWidth.Thin
letteringPreferences1.SetGeneralText(Annotations_Lettering1)
theSession.Parts.Work.Annotations.Preferences.SetLetteringPreferences(letteringPreferences1)
Dim stringArray1(1) As String
stringArray1(1) = mydate
Dim point3d1 As Point3d = New Point3d(4.3, 6.59, 0)
Dim note1 As Note
note1 = theSession.Parts.Work.Annotations.CreateNote(stringArray1, point3d1, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Dim stringArray2(1) As String
stringArray2(1) = UCase(Aline1)
Dim point3d2 As Point3d = New Point3d(1.7, 7.8, 0)
Dim note2 As Note
note2 = theSession.Parts.Work.Annotations.CreateNote(stringArray2, point3d2, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Dim stringArray3(1) As String
stringArray3(1) = Tapeno
Dim point3d3 As Point3d = New Point3d(4.33, 5.65, 0)
Dim note3 As Note
note3 = theSession.Parts.Work.Annotations.CreateNote(stringArray3, point3d3, AxisOrientation.Horizontal, letteringPreferences1, userSymbolPreferences1)
Any help would be greatly appreciated.
Regards,
Rick D
Win7 64 bit w/NX9.0.3.4 MP9 and NX10.0.2
Vericut 7.4