Skip to main content

Speos Labs automation APIs 2024 R1

GetPID

Last update: 17.07.2025

Description

Returns the process ID of the current instance of the Viewer/Editor.

Syntax

object.GetPID() As Long

object: XM3Viewer object

VB script example

Sub TestLab()
  ' Starts the application
  Dim Viewer
  Set Viewer = CreateObject("Xm3Viewer.Application")
  Dim RetVal
  ' Gets the PID
  RetVal = Viewer.GetPID()
End Sub

IronPython example

from System import Type, Activator
type = Type.GetTypeFromProgID("Xm3Viewer.Application")
MyXm3Viewer = Activator.CreateInstance(type)
# Gets the PID
MyXm3Viewer.GetPID()

Connect with Ansys