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.
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
Or the view outline is oversize to the geometry of the actual part?
RE: SW Drawing Viewport
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
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
RE: SW Drawing Viewport
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
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
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
RE: SW Drawing Viewport
-handleman, CSWP (The new, easy test)
RE: SW Drawing Viewport
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
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
-handleman, CSWP (The new, easy test)
RE: SW Drawing Viewport
RE: SW Drawing Viewport
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
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