Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help on Following journal

Status
Not open for further replies.

Altojoe

New member
Mar 16, 2013
23
0
0
IN
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
 
Replies continue below

Recommended for you

Thanks Cowski, Thats Worked well. Also I want to Extend it to all sheets like a stamp in all sheets Do i need to loop the command to all the sheets or anyother option Available.
 
You could wrap your code in a loop that works on each sheet in the array, or you could loop through the part's .Notes collection. This would give you access to all the notes in the part file regardless of the sheet it resides on; also, you would be able to eliminate the object type check since every object returned would be a note object.

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top