Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

Re: Move view to second application window by macro / VBA

$
0
0

Here's an attempt at a switch-screen macro using MDL function calls. I'm not in a position to test this, since I have only a single screen.

' ---------------------------------------------------------------------
' MDL function declarations go at beginning of module, before any
' VBA procedures
' ---------------------------------------------------------------------

Declare Function mdlWindow_screenNumGet Lib "stdmdlbltin.dll" ( _
      ByVal windowP As Long ) As Long
Declare Function mdlWindow_viewWindowGet Lib "stdmdlbltin.dll" ( _
      ByVal viewNum As Long ) As Long
Declare Function mdlWindow_changeScreen Lib "stdmdlbltin.dll" ( _
      ByVal windowP As Long , _
      ByVal oldScreen As Long , _
      ByVal newScreen As Long , _
      ByRef newGlobalOriginP As LPoint2d , _
      ByRef newContentExtentP As LPoint2d , _
      ByVal leaveAtCurrentPriority As Long ) As Long
' ---------------------------------------------------------------------
TestSetViewScreen ()
SetViewScreen 1, 2
End Sub
' ---------------------------------------------------------------------
' Set View Screen
' Args:
' viewNum: Long 1..8
' screen: Long 1 to number of physical screens
' ---------------------------------------------------------------------

Sub SetViewScreen (ByVal viewNum As Long, ByVal screen As Long)
   Dim window As Long
   window = mdlWindow_viewWindowGet (viewNum - 1)
   Dim currentScreen As Long
   currentScreen = mdlWindow_screenNumGet (window)
   mdlWindow_changeScreen window, currentScreen, screen - 1, 0, 0, 0
End Sub

Regards, Jon Summers
LA Solutions


Viewing all articles
Browse latest Browse all 1677


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>