DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Serialize sheet frame

API method: ILDXObject5.Serialize

 ' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrame.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc, APIHelpModes.InputParaDesktopOnly}, "", "LDXObject~Serialize", "Serialize sheet frame")>
 Public Shared Sub SerializeSheetFrame(ByRef ldxDocument As DigiPara.LDX.LDXDocument, ByVal pathToDesktop As String)

     If ldxDocument.Sheets Is Nothing Or ldxDocument.Sheets.ActiveSheet Is Nothing Then
         MsgBox("Active sheet not found! Please reload the .ld3 file.")
         Exit Sub
     End If

     If MsgBox("Do you want to load a sheet frame? If not the active sheet frame will be saved onto the desktop.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
         With ldxDocument.Sheets.ActiveSheet.Add(DigiPara.LDX.SheetAddOptions.saoCalculateDefaultPlacement)
             .Object.Serialize(
                      DigiPara.LDX.ObjectSerializeOperation.obsOperReadFile,
                      System.IO.Path.Combine(ldxDocument.Application.PoolPath, "Sheets", "DynamicFrames", "Scaffolding Plan.ldf"),
                      DigiPara.LDX.ObjectSerializeOption.obpAddClasslist)
             .X0 = 500
             .Y0 = 100
         End With
     Else
         With ldxDocument.Sheets.ActiveSheet.ActiveSheetFrame.Object
             .Serialize(
                      DigiPara.LDX.ObjectSerializeOperation.obsOperWriteFile,
                      System.IO.Path.Combine(pathToDesktop, System.IO.Path.GetFileName(DirectCast(.GetStorages.Item("SHFRITEM_FILENAME").Object.LDXType, DigiPara.LDX.LDXObjectStorageText).Text)),
                      DigiPara.LDX.ObjectSerializeOption.obpAddClasslist)
         End With
     End If

 End Sub