@Curtis_Waguespack
I found the solution which is to use CODE39 style and add "*" at first and last of the value of my barcode. Now I am trying to find the note in the sheet which has "SKID#: " in the content and if found then copy the whole content and make a new note where the location of the note is 1" right and 1" down from the top left corner of the sheet and paste the copied content in the new note without "SKID#: " and add * at front and end, then change the note style to "CODE39" as I have it defined in my document which will flip it to barcode. My Ilogic code is not working the way I want it to. Can you please help me fix that?
' iLogic Script for finding the note with "SKID#: ", copying it, and placing it at a new location
' Define the active document as a drawing document
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
' Get the current drawing sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
' Get all the drawing notes on the sheet
Dim oNotes As DrawingNotes
oNotes = oSheet.DrawingNotes
Dim skidNote As DrawingNote = Nothing
' Find the note that contains "SKID#: "
For Each oNote As DrawingNote In oNotes
If oNote.Text.Contains("SKID#: ") Then
skidNote = oNote
Exit For ' Exit loop once the note is found
End If
Next
' If no note containing "SKID#: " was found, show a message
If skidNote Is Nothing Then
MessageBox.Show("No note containing 'SKID#: ' found on the sheet.")
Return
End If
' Get the content of the note
Dim noteContent As String
noteContent = skidNote.Text.Replace("SKID#: ", "")
' Add "*" at the beginning and end of the note content
Dim modifiedNoteContent As String
modifiedNoteContent = "*" & noteContent & "*"
' Define 1 inch down from the top and 1 inch right from the left as the new note position
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim newNotePosition As Point2d
newNotePosition = oTG.CreatePoint2d(1, oSheet.Height - 1)
' Create a new drawing note with the same content at the new position
Dim copiedNote As DrawingNote
copiedNote = oSheet.DrawingNotes.Add(newNotePosition, modifiedNoteContent)
' Set the text style to "CODE39" (assuming the style is available)
Dim textStyle As TextStyle
textStyle = oDoc.StylesManager.TextStyles.Item("CODE39")
copiedNote.TextStyle = textStyle
' Align the copied note (optional, based on desired alignment)
copiedNote.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft
copiedNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextMiddle ' Use middle alignment
MessageBox.Show("Note copied and moved to the new location successfully!")