-
Hello, I am trying to zoom to a Despite the Relevant code: const ZoomToElementsWidget = () => {
const iModelConnection = useActiveIModelConnection();
const applyZoom = async () => {
if (iModelConnection) {
const id = "0xffffff0000000001"; // Decorator transientId
const vp = IModelApp.viewManager.selectedView;
if (vp) {
await vp.zoomToElements(id, {
animateFrustumChange: true,
standardViewId: StandardViewId.Iso,
});
}
iModelConnection.selectionSet.replace(id);
}
};
return (
<div className="sample-options">
<div className="sample-grid">
<Button
styleType="high-visibility"
className="zoom-controls-d"
onClick={applyZoom}
>
Zoom to Selected Element
</Button>
</div>
</div>
);
}; The target here is a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Once it has the bounding boxes ("placements"), it forwards them to zoomToPlacements. If you have or can compute a Placement for your decoration, pass it to |
Beta Was this translation helpful? Give feedback.
zoomToElements
queries the backend for the bounding boxes of the elements specified. It can't do anything useful with decorations because they're not elements.Once it has the bounding boxes ("placements"), it forwards them to zoomToPlacements.
If you have or can compute a Placement for your decoration, pass it to
zoomToPlacements
directly.