Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long
Sub main() On Error Resume Next Dim swApp As SldWorks.SldWorks Set swApp = Application.SldWorks If Not swApp Is Nothing Then Dim Part As SldWorks.ModelDoc2 Set Part = swApp.ActiveDoc
Dim swSelMgr As SldWorks.SelectionMgr Set swSelMgr = Part.SelectionManager()
If Not Part Is Nothing And Not swSelMgr Is Nothing Then boolstatus = Part.ActivateView("Detail View A (4 : 1)") boolstatus = Part.Extension.SelectByID2("Detail View A (4 : 1)", "DRAWINGVIEW", 0.3567189637584, 0.2569348080537, 0, False, 0, Nothing, 0) Dim swView As SldWorks.View Set swView = swSelMgr.GetSelectedObject6(1, -1) If Not swView Is Nothing Then Dim vArr As Variant vArr = swView.Position
vArr(0) = 0.37 '' moving X axis swView.Position = vArr vArr(1) = 0.25 '' moving Y axis swView.Position = vArr Call Part.EditRebuild3 Call MsgBox("Current View Coordinates: X = " & vArr(0) * 1000 & "mm, Y = " & vArr(1) * 1000 & "mm") End If Set swView = Nothing End If Set swSelMgr = Nothing Set Part = Nothing End If Set swApp = Nothing If Err.Number <> 0 Then Err.Clear End Sub