Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everybody,
I made a piece of iLogic code that puts text in a desired place. Only now I want to adjust the size of the text. Below is an example of what I have now and what I want.
Does anyone know how I can do this?
This is my code so far.
Sub Main
Dim Sheet
Sheet = "page1:1"
DeleteNote(Sheet)
TextX = 5
TextY = 5
AddNote(Sheet, TextX, TextY, scale)
End Sub
'-----Deleting note-----
Sub DeleteNote(Sheet)
oActiveSheet = ThisDrawing.Sheet(Sheet).Sheet
For Each oGeneralNote In oActiveSheet.DrawingNotes.GeneralNotes
If oGeneralNote.Rotation = 0.01
oGeneralNote.Delete
End If
Next
End Sub 'DeleteNote
'-----Adding note-----
Sub AddNote(Sheet, TextX, TextY, scale)
oActiveSheet = ThisDrawing.Sheet(Sheet).Sheet
' Tekst what is going to be placed
tekst = "test"
XPos = TextX
YPos = TextY
oNote = oActiveSheet.DrawingNotes.GeneralNotes.AddFitted(ThisApplication.TransientGeometry.CreatePoint2d(XPos, YPos), tekst)
' When adding the note, it is placed at a small angle. Searching for text at this angle can remove it again.
With oNote
.Rotation = 0.01 'radianti
End With
oActiveSheet.Update()
End Sub 'AddNote
I look forward to your response.
Solved! Go to Solution.