Clone a TCustomDiagramBlock

Hello

I want to clone a TCustomDiagramBlock, but the method "assign"does not work (an error is generated). Do you have a suggestion?

Thank you

It's not possible to do that directly, you must create a new diagram block and copy all properties that matter for you (bitmap, colors, fills, etc.).

One workaround you can do is to copy/paste the block, this way:

with atDiagram1 do
begin
  UnSelectAll;
  MyBlock.Selected := true;
  CopyToClipboard;
  PasteFromClipboard;
  MyCopiedBlock := Selecteds[0];
end;

Ok, Thanks