GefObject.Duplicate (method)

Creates a duplicate of the object.
Syntax: Set GefObject = object.Duplicate ( NewName, DestContainer )
Parameters:
Optional NewName As String -
Optional DestContainer As GefObjects -
Description: If NewName is specified that name will be used as the base name for the duplicate.

If the DestContainer parameter is specified, the object is duplicated into that container. If that parameter is omitted, the object is duplicated in its current container.

Example:

Sub GefObject_Duplicate()
    
    Dim oCimObj As GefObject
    Dim oCimDupObj As GefObject
    
    Set oCimObj = CimGetObject
    Set oCimDupObj = oCimObj.Duplicate("DuplicateObject", CimGetScreen.Object.Objects)
    oCimDupObj.Left = (500 * Rnd) * 20
    oCimDupObj.Top = (500 * Rnd) * 20
    CimGetScreen.Refresh False
    
End Sub