Saving / restoring collapsed ranges to / from file

Having quite big script, is there the way to save collapsed blocks point and restore it on loading the file?

I tried and can use GetOutlineRange and SetOutlineRange.

What works:

Collapse some code

Get outlines to List

Outline all

Restore with Set outline and previously taken ranges list.

Doesn’t :

Storing it to XML or binary file and reading back.

Can’t serialize as it is not marked as serializable.

I am sure there must be the way.



Hi Mike,

Sorry for the late reply. It should be possible to save/load outline ranges with a bit of extra code, we will provide an example shortly.

Kind regards,

Please take a look at this demo project - it shows how to save outlining to an XML file load outlining back (or load only the visible state in the existing outline ranges).

Let me know if this is what you’re looking for.

Kind regards,