×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SW Drawing Viewport

SW Drawing Viewport

SW Drawing Viewport

(OP)
Hello,
Did SW fix the drawing view boarder/viewport in SW2008 SP4.0? Everytime I reframe a drawing for filing, the drawing sheet doesn't reframe correctly (offsets)because the models (assy or part) viewport on the sheet is so large. I remember on older releases you could manually change the boarder/viewport size.

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2008 SP 3.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
I'm just a little verklempt. Talk amongst yourselves. I'll give you a topic. Pink Floyd, was neither Pink nor Floyd. Discuss!--"Coffee Talk" Mike Myers SNL
 

RE: SW Drawing Viewport

The views are coming in oversize to the drawing sheet border?

Or the view outline is oversize to the geometry of the actual part?

cheers

RE: SW Drawing Viewport

(OP)
CBL,
They're coming from the views when parts or assemblies are dragged and dropped onto the drawing sheet. See attached.

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2008 SP 3.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
I'm just a little verklempt. Talk amongst yourselves. I'll give you a topic. Pink Floyd, was neither Pink nor Floyd. Discuss!--"Coffee Talk" Mike Myers SNL
 

RE: SW Drawing Viewport

Colin,

I found this in SWX Help:
View Boundaries
When the pointer passes over the edge of a drawing view, the view boundary is highlighted. The boundaries are tightly fitted around the view by default; you cannot manually resize them. If you add sketch entities to a drawing view, the boundary automatically resizes to include these items. The boundary does not resize to include dimensions or annotations. View boundaries, and the views they contain, can overlap.

The resizing we used to be able to do was limited in that you could make the view boundaries larger, but you could not make them smaller then the bounding area for the view.  It appears we cannot resize and the boundaries are set to the bounding area.  It also appears when you resize a drawing it will go to the extents/boundaries of the drawing border or views, whichever is larger.

Your drawing view appears larger than it needs to be.  Do you have some components unsuppressed, but hidden?  I think the bounding area includes all unsuppressed parts whether they are hidden or not.

- - -Updraft
 

RE: SW Drawing Viewport

Also check for oversize Ref Planes, axes, errant geometry, etc, at all assy and component levels.

cheers

RE: SW Drawing Viewport

In the meantime, you could use this zoom to sheet macro.

Option Explicit

Sub main()
    Dim swApp As SldWorks.SldWorks
    Dim Part As SldWorks.ModelDoc2
    Dim swPS As SldWorks.PageSetup
    Dim X As Double
    Dim Y As Double
    
    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc
    Set swPS = Part.PageSetup
    
    'Gets paper width/lengh in .1mm inc and converts to meters
    X = swPS.PrinterPaperWidth / 10 / 1000
    Y = swPS.PrinterPaperLength / 10 / 1000
    
    'Part.ViewZoomTo2 0.00020564, 0.216162, -1.80748E-15, 0.278656, 0.000460558, -3.01247E-16
    Part.ViewZoomTo2 -0.01 * X, 1.01 * Y, 0, 1.01 * X, -0.01 * Y, 0
End Sub

RE: SW Drawing Viewport

(OP)
Wow, thanks for your help guys!

takedownca,
not all that good with macro's, but will try this.

Thanks a bunch!

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2008 SP 3.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
I'm just a little verklempt. Talk amongst yourselves. I'll give you a topic. Pink Floyd, was neither Pink nor Floyd. Discuss!--"Coffee Talk" Mike Myers SNL
 

RE: SW Drawing Viewport

So... what is the advantage of this macro over Zoom to Fit?  Sort of a "print preview" to see if your sheet format and printer paper size match?   

-handleman, CSWP (The new, easy test)

RE: SW Drawing Viewport

handleman,
Zoom to Fit sizes out to the extents.  It is nearly useless on a drawing which has views whose size extents outside of the drawing space.

macduff,
The functionality to resize views was removed back in 2004, I think.  It was a bad move that left more advanced users, like my self, out in the cold in our abilities to control drawing templates.  They didn't take the functionality out of the API, but since control of the sizes was evaluated so often by the program, using API to adjust the sizes is pointless.  What SW should've done is set a toggle in the properties for each view to allow a user to access the control of its size when needed.   

Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group

RE: SW Drawing Viewport

handleman,
Like Matt said, its just a more standardized version of Zoom to Fit that isn't affected by views or other entities laying off the sheet somewhere.  If you've ever used a reference BOM or table that wasn't meant to be printed, you'll know how annoying the built-in Zoom to Fit can be.

I suppose you could modify the macro to act like a print preview, but that's not what it currently does since it uses the drawing sheet size, not the printer's page size. So even if they didn't match it will still zoom to the entire page.

 

RE: SW Drawing Viewport

What do you think PrinterPaperWidth is?

-handleman, CSWP (The new, easy test)

RE: SW Drawing Viewport

It's the what SW thinks the print size is, i.e. drawing sheet size.  If you have a D size sheet and are printing on A size, PrinterPaperWidth will report the width corresponding to D, not A.  So you can change the printer's paper settings all you want, but this particular macro will not zoom any differently.

RE: SW Drawing Viewport

Err...No.

There are three different places to tell SW the sheet size.  One is in the sheet properties (right click on the sheet and choose "Properties".  This will dictate the size of the "paper" area shown in the graphics area of SW.  If you want to confirm this, first run your macro.  Then, right-click on your sheet and choose "Properties".  There is a radio button for "Custom sheet size".  Click that button and then enter something like 20mm for width and 50mm for height.  Now run your macro again and see if you zoom to the new paper.  The size of the displayed sheet is accessed through the API via the Sheet::GetSize function.  Another place to choose paper size is in the File->Print Setup dialog.  This is where you can tell SW what to tell the printer to print on.  This is the size reported by PageSetup::PrinterPaperWidth.  The PrinterPaperWidth and PrinterPaperLength properties are set when you select a paper size from this dialog.  SW will then tell the printer what paper to use.  Finally, you can set the paper size by hitting the "Properties" button in the File->Print dialog, but then hitting "Cancel" instead of "Print" after closing the printer's properties dialog.  After doing this, you can go to File->Print Setup and the dropdown will show the same paper size you chose in the printer's Properties dialog, but the PrinterPaperLength and PrinterPaperWidth will still not be updated.  



If you really want to always show the "paper" in the SolidWorks viewing window, use this:

CODE

Option Explicit

Sub main()
    Dim swApp As SldWorks.SldWorks
    Dim Part As SldWorks.ModelDoc2
    Dim swDwg As SldWorks.DrawingDoc
    'Dim swPS As SldWorks.PageSetup
    Dim swSheet As SldWorks.Sheet
    Dim X As Double
    Dim Y As Double
    
    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc
    Set swDwg = Part
    Set swSheet = swDwg.GetCurrentSheet
    'Set swPS = Part.PageSetup
    
    'Gets paper width/lengh in .1mm inc and converts to meters
    swSheet.GetSize X, Y
    'X = swPS.PrinterPaperWidth / 10000
    'Y = swPS.PrinterPaperLength / 10000
    
    
    
    
    'Part.ViewZoomTo2 0.00020564, 0.216162, -1.80748E-15, 0.278656, 0.000460558, -3.01247E-16
    Part.ViewZoomTo2 -0.01 * X, 1.01 * Y, 0, 1.01 * X, -0.01 * Y, 0
End Sub

-handleman, CSWP (The new, easy test)

RE: SW Drawing Viewport

Well, when you're wrong you're wrong.  Upon doing a little digging, you're absolutely correct.  I think I created that macro while I was working on some patent drawings that happen to have the correct page size setting under Page Setup.  So as far as I knew, it worked perfectly. Today's as good a day as any to learn something new :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources