08-30-2022
01:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-30-2022
01:29 AM
Dim oApp = ThisApplication Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawingDoc.ActiveSheet For Each oSheet In oDrawingDoc.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 oBorder = oSheet.Border Dim oNewPosition As Point2d oPlaceX = oBorder.RangeBox.MinPoint.X + 0.1 oPlaceY = oBorder.RangeBox.MinPoint.Y + 0.25 'Set reference to the new required position taken and create new 2d point oNewPosition = oTG.CreatePoint2d(oPlaceX,oPlaceY) ' 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
Change the red to a desired position. if you want it in the right bottom corner change the green text to Max.