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

Visibility of view off sheet

Anonymous

Visibility of view off sheet

Anonymous
Not applicable

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?

0 Likes
Reply
Accepted solutions (1)
456 Views
3 Replies
Replies (3)

JelteDeJong
Mentor
Mentor
Accepted solution

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

0 Likes

JamieVJohnson2
Collaborator
Collaborator

  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
0 Likes

Anonymous
Not applicable

Thank you for the quick and complete response!

This is exactly what I was looking for.

0 Likes