DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Save .ld3 file

API method: ILDXDocument5.Save

2 code examples follow.

Example 1: Save .ld3 file

 ' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXApp, APIHelpModes.InputParaDesktopWithOtherFileName, "LD API Example.ld3"}, "", "LDXDocument~Save", "Save .ld3 file")>
 Public Shared Sub Save(ldxApplication As DigiPara.LDX.LDXApplication, targetFilePath As String)

     If ldxApplication.ActiveDocument Is Nothing Then
         MsgBox("Active document not found!")
         Exit Sub
     End If

     If Not System.IO.File.Exists(targetFilePath) Then
         ' New file
         MsgBox(If(ldxApplication.ActiveDocument.SaveAs(targetFilePath) = 1, "File saved successfully", "File was not successfully saved"))
     Else
         ' File already exists
         MsgBox(If(ldxApplication.ActiveDocument.Save = 1, "File saved successfully", "File was not successfully saved"))
     End If

 End Sub

Example 2: Save work

 ' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXApp}, "", "LDXDocument~Save", "Save work")>
 Public Shared Sub SaveWork(ldxApplication As DigiPara.LDX.LDXApplication)

     If ldxApplication.ActiveDocument Is Nothing Or ldxApplication.ActiveDocument.GetFirstLDXObjectByAsterisk("Shaft*") Is Nothing Then
         MsgBox("Shafts not found!")
         Exit Sub
     End If

     ldxApplication.ActiveDocument.Save()


 End Sub