I use modelToSheetTransform
in viewports data to map position between 3d and sheet view.
I have 1 3d view with some sheets with it, but 1 of my sheets have wrong position after map, the other sheets are correct. Did I miss some setting in my sheet or was I setting something wrong?
This is my code to map position:
const aecData = await Autodesk.Viewing.Document.getAecModelData(
viewer.model.getDocumentNode()
);
const viewport = aecData.viewports.find(
(v: any) => v.sheetGuid === sheetGuid
);
const sheetUnitScale = viewer.model.getUnitScale();
modelToSheetTransformMatrix = Autodesk.AEC.AecModelData.get3DTo2DMatrix(
viewport,
sheetUnitScale
).clone();
Not sure what the Revit model version generating or saving your Revit model is.
Probably, it's related to a known issue. Could you try to omit the modelToSheetTransform before loading 'Autodesk.AEC.LevelsExtension' and 'Autodesk.AEC.ViewportsExtension' to see if it helps?
Viewer will use another approach to calculate the transform, but please ensure your floor plans and sheets are configured with the rules in this link:
https://stackoverflow.com/a/69941583/7745569
If the above doesn't help, please consider providing a test Revit model reproducing this issue to
aps (DOT) help (AT) autodesk (DOT) com
for investigations and pointing out which views can reproduce this issue in the email.ref: