- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to copy a drawing note from one document to another. The problem is that the new drawing note has a different RangeBox size than the drawing note that was copied from.
I can't seem to resize it, this note contains parameters and when they are filled, the length of the line of text exceeds the maximum length and jumps to the line.
I tried with AddByRectangle and AddFitted but the RangeBox of the new drawing note is always minimized. I also tried with GetBoxData and PutBoxData but this gives me an error message and the RangeBox is always reduced to the minimum.
Does someone have an idea?
Dim oTemplateFileName As String = "--\Inventor\---\Templates\Standard.dwg" Dim oTemplateDoc As DrawingDocument = ThisApplication.Documents.Open(oTemplateFileName, False) Dim oDrawDoc As DrawingDocument = ThisDoc.Document Dim oSheet As Sheet = oDrawDoc.ActiveSheet For Each oNote As DrawingNote In oTemplateDoc.ActiveSheet.DrawingNotes If oNote.Type.ToString = "kGeneralNoteObject" Then ' Test GetBoxData Dim MinPoint(2) As Double Dim MaxPoint(2) As Double Call oNote.RangeBox.GetBoxData(MinPoint, MaxPoint) ' Test with AddByRectangle Dim oCorner1 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oNote.RangeBox.MinPoint.X, oNote.RangeBox.MaxPoint.Y) Dim oCorner2 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oNote.RangeBox.MaxPoint.X,oNote.RangeBox.MinPoint.Y) Dim oNewNote As DrawingNote = oSheet.DrawingNotes.GeneralNotes.AddByRectangle(oCorner1, oCorner2, oNote.FormattedText) ' Test with AddFitted 'Dim oNewNote As DrawingNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oNote.Position, oNote.FormattedText) ' Test PutBoxData Call oNewNote.RangeBox.PutBoxData(MinPoint, MaxPoint) End If Next
Drawing note for reference :
Drawing note after copy :
Is it possible to change the size of the RangeBox?
Thanks. Vincent.
Solved! Go to Solution.