# Are there any OOTB methods to serialize/deserialize the current view to/from json (or xml)

**URL:** <https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292>\
**Category:** HOOPS Visualize Web\
**Created:** [July 5, 2023, 5:18pm UTC](https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292 "2023-07-05T17:18:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkat](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@venkat](https://forum.techsoft3d.com/u/venkat)\
**Post date:** [July 5, 2023, 5:18pm UTC](https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292/1 "2023-07-05T17:18:19Z")

</div>

Are there any OOTB methods to

- serialize the current view to json/xml
- restore the view back from json/xml?

Thanks,  
ven

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [July 6, 2023, 12:28pm UTC](https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292/2 "2023-07-06T12:28:30Z")

</div>

Hello @venkat. Communicator does not have out-of-the-box functions for serializing and deserializing the [Communicator.View](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.View.html?highlight=communicator.view#view) object. It is possible to serialize/deserialize one part of the View object, that being the [Camera](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.Camera.html?Communicator.Communicator.Camera.toJson#camera) through the methods [Camera.toJson()](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.Camera.html?Communicator.Communicator.Camera.toJson#camera) and [Camera.fromJson()](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.Camera.html?Communicator.Communicator.Camera.toJson#camera).

---

<div class="post-metadata">

**Author:** ![rtadlock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/rtadlock/32/14_2.png) [@rtadlock](https://forum.techsoft3d.com/u/rtadlock)\
**Post date:** [July 6, 2023, 9:36pm UTC](https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292/3 "2023-07-06T21:36:44Z")

</div>

Hi @venkat,

As Tino mentioned, you can save and restore the camera using the above mentioned APIs. You can also use the [Communicator.MarkupManager](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.MarkupManager.html) class to save off various parts of the view. The class as a function called [exportMarkup()](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.MarkupManager.html#Communicator.Communicator.MarkupManager.exportMarkup) that will save off the following:

- Camera
- Sheet ID (If the model is a drawing with sheets)
- Exploding magnitude
- Line visibility
- Face visibility
- Markup items
- Node ID color map
- Snapshot image

I believe that in the latest version, we also safe the state of cutting planes in the view, but you’ll have to verify that. You can create a view in the in the MarkupManager that will save off model state, which you can then serialize to json and reload later. You can read more about all of this here: [Markup Basics — HOOPS Communicator 2023 SP1 Documentation](https://docs.techsoft3d.com/communicator/latest/prog_guide/viewing/markup/markup-basics.html#markup-manager-overview)

---

<div class="post-metadata">

**Author:** ![venkat](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@venkat](https://forum.techsoft3d.com/u/venkat)\
**Post date:** [July 6, 2023, 11:15pm UTC](https://forum.techsoft3d.com/t/are-there-any-ootb-methods-to-serialize-deserialize-the-current-view-to-from-json-or-xml/2292/4 "2023-07-06T23:15:18Z")

</div>

Thank you @tino and @rtadlock for the timely reply. I was planning to use markup along with some node-related information stored separately. Just wanted to make sure I wasn’t missing existing functionality. Regards -venkat
