08-30-2022
12:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-30-2022
12:35 AM
I was working on that.
Dim oApp = ThisApplication Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawingDoc.ActiveSheet
For Each oSheet In oDrawDoc.Sheets For Each oGeneralNote In oSheet.DrawingNotes.GeneralNotes
oGeneralNote.Delete
next
next
For Each oSheet In oDrawingDoc.Sheets oViews = oSheet.DrawingViews Dim oView As DrawingView For Each oView In oViews Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument Dim oFullFilePath As String = oModelDoc.FullFileName 'MsgBox(oModelDoc.FullFileName) Dim Input As String = oFullFilePath Dim folders = Input.Split("\").Skip(5) Dim newPath = String.Join("\", folders) 'MsgBox(newPath) ' Set a reference to the TransientGeometry on active sheet. Dim oTG As TransientGeometry oTG = oApp.TransientGeometry Dim oNewPosition As Point2d 'Set reference to the new required position taken and create new 2d point oNewPosition = oTG.CreatePoint2d(oView.Center.X, oView.Center.Y - (oView.Height / 2) - 1) ' oSheet.DrawingNotes.GeneralNotes.AddFitted(ThisApplication.TransientGeometry.CreatePoint2d(DrawingView.position.x - DrawingView.width / 2, DrawingView.position.y - DrawingView.height / 2 - 1), newPath) oSheet.DrawingNotes.GeneralNotes.AddFitted(oNewPosition,newPath) 'iProperties.Value("Custom", "05-Opmerking") = newPath Next Next