On a Form I put a Diagram (atDiagram1), then define 2 Layers (0 and 1). By default, both of them are editable and visible.
In the diagram I put 2 DiagramBlocks (DiagramBlock1 and DiagramBlock2). By default, both of them belong to Layer 0. I change Layer of DiagramBlock2 to 1 and … It disappears… Why ?
If the two blocks are in layer 0 and you then make the layer 0 visible (Button2Click), the blocks will disappear.
Your code sample is very limited and doesn't show all the steps you are doing. If that's not the case, please provide a simple code that reproduces the issue from the beginning.
OK, maybe I have found the right way to do it : the Layers must have a LayerName (Lay0, Lay1 for example) and the DiagramBlocks belong to the Layers by their property LayerName, not by their property Layer (which can be 0 for the two DiagramBlocks). Well… it’s a bit strange but like that it works.