Added LinkPoints is not saved to file

If I by code add extra LinkPoints to a block those extra LinkPoints will not be saved to file using the SaveToFile method. So if I add extra LinkPoints to a block, save the diagram to file and then later opens the file all added LinkPoints are missing. Extra added TextCells will be saved to file so it is a bit inconsistent. Is there any easy solution to this or do I have to write additional code i my application to save the extra LinkPoints data?

Hello @Larsson_Niklas, welcome to TMS Support Center!

Yes, that behavior is by design, and depends on the block you are using. What exact block class are we talking about?

But yes. Link points are supposed to be created in the Create constructor in an inherited class, it's considered part of block behavior.

You can always create your own block inherited from any of other blocks and make LinkPoints property published.

Hi Wagner

Thanks for your reply. I have only tested on the FlowActionBlock that seems to have that behaviour. I guess I'm not stuck to that block type in my project and will test with other suited block types if they work differently. Otherwise I will your suggestion to create my own custom block.

1 Like

Solution: I ended up by making some custom block type inherited from TFlowActionBlock where I added all extra LinkPoints that I need.

For future readers: For making custom blocks, see for example the FlowchartBlocks.pas unit file to copy code needed.

@wlandgraf: Thanks for this solution.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.