procedure(copyLayer()
let((cv objSet)
;; get selected objects
cv = geGetEditCellView()
objSet = geGetSelectedSet()
;; get current active layer
activeLayer = leGetEntryLayer()
actLayerName = car(activeLayer)
actLayerPurpose = cadr(activeLayer)
;; copy and change the layer
foreach(x objSet
y = dbCopyFig(x nil)
y->layerName = actLayerName
y->purpose = actLayerPurpose
);end foreach
);end let
);end procedure
hiSetBindKey("
layout" "Ctrl<Key>r" "copyLayer()")