DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Clone an object that can be copied

API method: ILDXObjects.Copy

 ' from Samples/Src/LDXAPIExamples/Example_LDXObjects.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "", "LDXObjects~Copy", "Clone an object that can be copied")>
    Public Shared Sub CloneAnObjectThatCanBeCopied(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

        If ldxDocument.GetLDXObject("Sheets.LdvSheet1.") Is Nothing Then
            MsgBox("Required sheet not found! Please reload the .ld3 file.")
            Exit Sub
        End If

        Dim ldxObjects As DigiPara.LDX.LDXObjects = ldxDocument.Sheets.ActiveSheet.ActiveSheetFrame.SelectedObjects

        With ldxObjects
            If .GetObjectChangeType = 0 Then
                MsgBox("Please select a clonable object from the drawing!")
                Exit Sub
            End If
            .Copy64(Nothing, 0)
            .Paste64(Nothing, "", "")
        End With

    End Sub