Get & Set Browser Size in the Creo Window using VB API

User can get and set the Creo browser size using VB API

Get Browser Size

Function GetBrowserSize () as Double
 
Returns the percentage of the graphics window covered by the embedded web browser.

Not applicable if browser is open in separate window.

Returns:
The percentage of the window covered, from 0.0 (the browser is minimized) to 100.0 (the browser covers the entire window).

Set Browser Size

Sub SetBrowserSize (BrowserSize as Double)

Sets the percentage of the graphics window covered by the embedded web browser.

Not applicable if browser is open in separate window.

Parameters:
BrowserSize
The percentage of the window to cover, from 0.0 (the browser is minimized) to 100.0 (the browser covers the entire window).

Sample Code

Get & Set Browser Size using VB API
    ' VARIABLE DECLARATION REQUIRED

    Public AConnection As IpfcAsyncConnection
    Public BSession As IpfcBaseSession

    Private Sub btn_GetBrowserSize_Click(sender As Object, e As RoutedEventArgs)
        Try
        ' AConnection must be declared at the time of Creo Connect or Creo Start function
  
            BSession = AConnection.Session
            Dim IWindows As IpfcWindow = BSession.CurrentWindow
            lb_GetBrowserSize.Content = "BROWSER SIZE" & IWindows.GetBrowserSize.ToString
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Failure")
        End Try
    End Sub

    Private Sub btn_SetBrowserSize_Click(sender As Object, e As RoutedEventArgs)
        Try
        ' AConnection must be declared at the time of Creo Connect or Creo Start function
  
            BSession = AConnection.Session
            Dim IWindows As IpfcWindow = BSession.CurrentWindow
            IWindows.SetBrowserSize(tb_SetBrowserSize.Text)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Failure")
        End Try
    End Sub

Thanks & Regards

Parthiban Kannan

Follow me in LinkedIn!

 

Share Now
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply