|
DigiPara Liftdesigner LDX API
|
' from Samples/Src/LDXAPIExamples/Example_LDOOP.vb
<APIHelpAttribute(APIHelpModes.None, {APIHelpModes.None}, "", "LDXApplication~Example_LDOOP_UI_Exclusive", "Use LDOOP_UI to get LD UI Application")>
Public Shared Sub LDOOP_UI()
' Alternatively to LDOOP_UI_Shared, you might want to spawn a new Liftdesigner process
' reference Interop.LDOOP_UI.dll, set 'embed interop types' to 'false'
Dim ldoopApplication As LDOOP_UI.LDOOP_UIApplication = New LDOOP_UI.LDOOP_UIApplicationClass()
' you need to start the actual user interface via StartUI.
Dim version = Assembly.GetEntryAssembly().GetName().Version
Dim majorVersion As Integer = version.Major ' you may want to hardcode this version
ldoopApplication.StartUI("DigiPara Liftdesigner 20" + majorVersion.ToString())
' retrieve LDX application
' here in VB.NET, the cast from object/IDispatch to LDXApplication via QueryInterface happens implicitly,
' in C# you need an "as LDX.LDXApplication" cast.
Dim ldxApp As LDX.LDXApplication = ldoopApplication.Application5
' it is running in a separate LDOOP_UI.exe process and accessed over an internal network link.
MessageBox.Show("Pool Path : " + ldxApp.PoolPath)
' When you are done, close the application to shut down the process (it will close itself after a while of not receiving NotifyStillLiving()).
' You might NOT want to do this, after all, Liftdesigner is visible to the user now and may be interacted with.
ldoopApplication.Quit()
End Sub