I found the solution and put it in a little function so everybody who might come accross the same question can use it:
;==============================================
; Function to copy Object Heap Variables
FUNCTION CopyHeap,OBJECT
temppath=FILEPATH("tempo",/TMP)
tempvar=OBJECT
SAVE,FILENAME=temppath,tempvar
temporary=temporary(tempvar)
RESTORE,temppath
RETURN,tempvar
END
;==============================================
; === example ====================================
a=plot([1,2,3],[42,42,42],/BUFFER,name="FIRST")
b=copyheap(a)
help,a,b
; this prints plots with different numbers and I think this function should work with any ObjHeapvariable
|