- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thank you for the quick and complete response!
This is exactly what I was looking for.