DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Clone first elevator in bank 1

API method: ILDXDocument5.TempObjectList

 ' from Samples/Src/LDXAPIExamples/Example_GroupsConfiguration.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "", "LDXDocument~TempObjectList", "Clone first elevator in bank 1")>
    Public Shared Sub CloneElevator(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

        If ldxDocument.Shafts.Count < 1 Then
            MsgBox("No shafts found")
            Exit Sub
        End If

        ' Clear the temporary list
        ldxDocument.TempObjectList.Clear()
        ' Add the shaft to copy to the list
        ldxDocument.TempObjectList.Add(ldxDocument.Shafts(0).Object.TreeName)
        ' Make a copy of the shaft (to clipboard)
        ldxDocument.TempObjectList.Copy64(Nothing, 0)
        ' paste shaft from clipboard (at the end of ldxDocument.Shafts)
        If (ldxDocument.TempObjectList.Paste64(Nothing, "", "") And DigiPara.LDX.ObjectChangeType.octModel) <> 0 Then
            Dim clonedLDXShaft As DigiPara.LDX.LDXShaft = ldxDocument.Shafts(ldxDocument.Shafts.Count - 1)
            ' If the paste of the shaft was successfull
            ' move the cloned shaft at the end of bank 1
            ldxDocument.Shafts.MoveShaft(clonedLDXShaft.Comp.SX, ldxDocument.Shafts.BANK_2_START_SX)
            ldxDocument.Shafts.BANK_2_START_SX = ldxDocument.Shafts.BANK_2_START_SX + 1
        End If

    End Sub