Skip to content

fly #521

Answered by pmconne
paprophet asked this question in Q&A
fly #521
Jan 5, 2021 · 1 comment
Discussion options

You must be logged in to vote

ViewState.toProps will give you a JSON representation of the view that you can save for later reuse.
To restore the view and apply it to a Viewport, do something like:

const viewClass = await imodel.findClassFor<typeof ViewState>(savedViewProps.viewDefinitionProps.classFullName, undefined);
if (viewClass) {
  const view = viewClass.createFromProps(savedViewProps, imodel);
  await view.load();
  viewport.changeView(view);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pmconne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants