09-30-2019
11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-30-2019
11:51 AM
try this code:
[iLogic]
Dim doc As DrawingDocument = ThisApplication.ActiveDocument
For Each sheet As Sheet In doc.Sheets
Dim sheetHeight As Double = sheet.Height
Dim sheetWidth As Double = sheet.Width
For Each view As DrawingView In sheet.DrawingViews
Dim viewMinX = view.Position.X + view.Width / 2
Dim viewMaxX = view.Position.X - view.Width / 2
Dim viewMinY = view.Position.Y + view.Height / 2
Dim viewMaxY = view.Position.Y - view.Height / 2
If (sheetWidth < viewMaxX) Or
(sheetHeight < viewMaxY) Or
(viewMinX < 0) Or
(viewMinY < 0) Then
view.Suppressed = True
Else
view.Suppressed = False
End If
Next
Nextpay attention it will only suppress views that are entirely outside the sheet
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com