Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
453 Views, 3 Replies

Visibility of view off sheet

I'm exporting drawings to .dxf to import into Solidworks (because that's what the customer wants), but some drawings have views that are outside of the paperspace / sheet.  They need to exist for reference, or to drive some extra sections, etc.

 

I know there are ways to manually suppress/hide them, but I have an ilogic macro that hides various things, exports the .dxf with appropriate settings, etc. so I'd like to add the suppression of all views that are off the paper.

 

If there's an option in the .dxf that accomplishes this, I'm fine with that too.

 

Any ideas?

JelteDeJong
in reply to: Anonymous

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
Next

pay 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.

EESignature


Blog: hjalte.nl - github.com

JamieVJohnson2
in reply to: Anonymous

  Dim vBase As DrawingView = something you found to be off the page by looking at view position (top left) and view width and view height, or just view range box, then comparing to sheet size/border.
            vBase.Suppressed = True

jvj
Anonymous
in reply to: JelteDeJong

Thank you for the quick and complete response!

This is exactly what I was looking for.