Skip to content

zoomToElements Function Throws Error When Operating on a Large Number of Elements #7437

Answered by pmconne
wangjing1111 asked this question in Q&A
Discussion options

You must be logged in to vote

zoomToElements uses getPlacementProps to build an ECSql query string that includes a WHERE criterion 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 zoomToElements directly with a huge list of element Ids, you can make multiple calls to getPlacementProps with much smaller lists of element Ids, accumulating a list of Placements to pass to zoomToPlacements. If you wanted to be more efficient, you could avoid allocating that huge list of Placements and instead simply compute the union of all of the bounding boxes. Either way, take a look at the implementation of zoomToElements to guide …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wangjing1111
Comment options

@pmconne
Comment options

Answer selected by wangjing1111
@wangjing1111
Comment options

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