Altojoe
New member
- Mar 16, 2013
- 23
Hi,
I created a following Journal to move a note orgin from one place to another, After running the note is still in the old Place.
After that I am not even able to select or move the note manually.But when i checked the note properties orgin got moved to new place but not the note.
Also i want to extend this for all sheets not for sheet by Sheet.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UI
Imports NXOpen.UF
Imports NXOpen.Annotations
Imports NXOpen.Drawings
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workpart As Part = theSession.Parts.Display
Dim Sheets As DrawingSheetCollection = workpart.DrawingSheets
Dim sheetArray As DrawingSheet() = Sheets.ToArray()
Dim currentSheet As DrawingSheet = Sheets.CurrentDrawingSheet
Dim objs As DisplayableObject() = currentSheet.View.AskVisibleObjects()
For Each obj As DisplayableObject In objs
If (TypeOf obj Is Note) Then
Dim Note1 As Note = CType(obj, Note)
For Each text_line As String In Note1.GetText()
if text_line.ToUpper.Contains("RX-400") then
dim point as point3d
point = Note1.AnnotationOrigin
Dim Point1 As Point3d = New Point3d(5.8612326801127, 0.542791619141274, 0.0)
note1.AnnotationOrigin = Point1
End If
Next
End If
Next
End Sub
End Module
I created a following Journal to move a note orgin from one place to another, After running the note is still in the old Place.
After that I am not even able to select or move the note manually.But when i checked the note properties orgin got moved to new place but not the note.
Also i want to extend this for all sheets not for sheet by Sheet.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UI
Imports NXOpen.UF
Imports NXOpen.Annotations
Imports NXOpen.Drawings
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workpart As Part = theSession.Parts.Display
Dim Sheets As DrawingSheetCollection = workpart.DrawingSheets
Dim sheetArray As DrawingSheet() = Sheets.ToArray()
Dim currentSheet As DrawingSheet = Sheets.CurrentDrawingSheet
Dim objs As DisplayableObject() = currentSheet.View.AskVisibleObjects()
For Each obj As DisplayableObject In objs
If (TypeOf obj Is Note) Then
Dim Note1 As Note = CType(obj, Note)
For Each text_line As String In Note1.GetText()
if text_line.ToUpper.Contains("RX-400") then
dim point as point3d
point = Note1.AnnotationOrigin
Dim Point1 As Point3d = New Point3d(5.8612326801127, 0.542791619141274, 0.0)
note1.AnnotationOrigin = Point1
End If
Next
End If
Next
End Sub
End Module