Hello:
I want to zoom to a window using predefined coordinates on a Drawing. A assume Z is 0.
As an example, for an A-size drawing I want to zoom from 0,0 to 10,7.5
I have this code, but every example I have viewed is about getting the coordinate values from the pick point. I do not want to pick a point.
Private Sub ZoomToRegion(_MatchDrawingFile As String, _Drawing As DrawingDoc, _swModel As ModelDoc2)
' Get Drawing Size
Dim adFile As IEdmFile7 = VAULT.GetFileFromPath(_MatchDrawingFile)
Dim PaperSize As String = Nothing
PaperSize = ReadPaperSize(adFile, _MatchDrawingFile)
Dim swSelMgr As SelectionMgr = _swModel.SelectionManager
Dim swMathUtil As MathUtility = SWAPP.GetMathUtility
Dim oSelPt1, oSelPt2 As Object
Dim swSelPt1, swSelPt2 As MathPoint
swSelPt1.ArrayData(0) = 0.00
swSelPt1.ArrayData(1) = 0.00
swSelPt1.ArrayData(2) = 0.00
swSelPt2.ArrayData(2) = 0.00
Select Case PaperSize
Case "A"
swSelPt2.ArrayData(0) = 0.254 ' 10"
swSelPt2.ArrayData(1) = 0.1905 ' 7.5"
Case "B"
swSelPt2.ArrayData(0) = 0.4064 ' 16"
swSelPt2.ArrayData(1) = 0.254 ' 10"
Case "C"
swSelPt2.ArrayData(0) = 0.5842 ' 23"
swSelPt2.ArrayData(1) = 0.4318 ' 17"
Case "D"
swSelPt2.ArrayData(0) = 0.889 ' 35"
swSelPt2.ArrayData(1) = 0.5842 ' 23"
End Select
_swModel.ViewZoomTo2(swSelPt1.ArrayData(0), swSelPt1.ArrayData(1), swSelPt1.ArrayData(2), swSelPt2.ArrayData(0), swSelPt2.ArrayData(1), swSelPt2.ArrayData(2))
End Sub
SolidworksApi/macros