DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Set legacy mode

API method: ILDXDocument5.DocumentLegacyMode

 ' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXApp}, "", "LDXDocument~DocumentLegacyMode", "Set legacy mode")>
 Public Shared Sub DocumentLegacyMode(ldxApplication As DigiPara.LDX.LDXApplication)

     Dim document As DigiPara.LDX.LDXDocument = ldxApplication.ActiveDocument
     If document Is Nothing Then
         MsgBox("Active document not found!")
         Exit Sub
     End If

     Dim description As String

     ' DocumentLegacyMode reverts LiftDesigner's behaviour back to that of previous LiftDesigner versions wherever possible. This mostly applies to non-critical bugfixes
     ' where the fix changed drawing output.
     If ((document.DocumentLegacyMode And DigiPara.LDX.DocumentLegacyModes.dlmVersionMask) = DigiPara.LDX.DocumentLegacyModes.dlmVersion14_0) Then
         ' Back to the default for new documents: behave like whatever the current version is, even if loaded in a future version of LiftDesigner
         document.DocumentLegacyMode = DigiPara.LDX.DocumentLegacyModes.dlmVendorDigiPara Or DigiPara.LDX.DocumentLegacyModes.dlmVersionCurrentFloating
         description = "Current code"
     Else
         ' Make document behave like 14.0 as much as possible
         document.DocumentLegacyMode = DigiPara.LDX.DocumentLegacyModes.dlmVendorDigiPara Or DigiPara.LDX.DocumentLegacyModes.dlmVersion14_0
         description = "Compatible with version 14.0"
     End If

     ' Recommendation for RefModel authors: Initialize new documents with
     'document.DocumentLegacyMode = DigiPara.LDX.DocumentLegacyModes.dlmVendorDigiPara Or DigiPara.LDX.DocumentLegacyModes.dlmVersion16_0
     ' replacing dlmVendorDigiPara with your company if applicable and dlmVersion16_0 with the current version you develop for.
     ' Bump that to new current versions whenever you implement a new RefModel. When you update an old RefModel, it's up to you whether you
     ' want to keep the version or bump it to the current one.

     ' purely cosmetic: Update texts in view frames to reflect current document status
     Dim sheet As DigiPara.LDX.LDXSheet
     Dim frame As DigiPara.LDX.LDXSheetFrame
     For Each sheet In document.Sheets
         For Each frame In sheet
             If frame.DeveloperName = "VERSION_INDICATOR" Then
                 frame.Description = description
             End If
         Next
     Next

 End Sub