zoomToElements Function Throws Error When Operating on a Large Number of Elements #7437
Answered
by
pmconne
wangjing1111
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
pmconne
Dec 2, 2024
Replies: 1 comment 3 replies
-
|
Hi @wangjing1111. You are almost certainly hitting a size limit. Why are you trying to zoom to 15,000 elements? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


zoomToElementsuses getPlacementProps to build an ECSql query string that includes aWHEREcriterion containing all of the Ids you supplied. There's a very high but finite limit on the length of that string. You're exceeding that limit.Instead of calling
zoomToElementsdirectly with a huge list of element Ids, you can make multiple calls togetPlacementPropswith much smaller lists of element Ids, accumulating a list ofPlacements to pass tozoomToPlacements. If you wanted to be more efficient, you could avoid allocating that huge list ofPlacements and instead simply compute the union of all of the bounding boxes. Either way, take a look at the implementation of zoomToElements to guide …