How can we get Crop box Outline of a view on Sheet?
Currently, I use BoxOutline node for Viewport that gets the Bounding box of the viewport (exclude the Title).
Then, I use View.Outline node for View. But this node just works correctly for Plan or RCP views. With Elevation or Section, the number is not right for both in model or in sheetpaper space.
View.GetCropbox also returned an incorrect location polycurve for paper space or model space.
Hi @Jin we have this post up here the other day, probably it could give a hint
is this what you are looking for?
Edit* Oh i see, when trying to get the CROP lines it flies off into neverland…
Yes, I dont know why when we get the crop and the viewport (maybe on sheetspace), the crop is not inside the viewport boundingbox.
Revit does not have model space and sheet space like AutoCAD. There’s nothing tying those two coordinate systems together, so when you get the crop extents of the view that’s with respect to the view’s coordinate system (global). When you reflect that on the sheet it’s with respect to the sheet’s coordinate system (usually relative to the TB).
If you want the view crop relative to the sheet, then you need to adjust for the viewport’s location on the sheet and (I’d imagine) the scale as well.
I understand that we need to scale to get the sheet distance from the View distance. The View.Outline can get the bounding box of cropbox on sheet (not include annotation or grid bubble outside the crop). The Viewport.BoxOutline gets all.
For floor plan, It works fine. For elevation or Section, the View.Outline is not correct.
I haven’t seen this, can you explain how it is wrong? Post an example and perhaps your graph and a sample dataset so others can help.
OK, thank you. I will post the image later.
Shortly, View.Outline returns the outline at “random” points, not their sheet space coordinates or revit 3d space coordinates. So I have no clue to get the vector from Viewport.BoxOutline.Minpoint to View.Outline.Minpoint.
Now, it’s error for Floor plan too!
The 2 lines in viewport is created from viewport.BoxOutline
The 2 lines near Sheet insert point is created from view.Outline.
Why are they not the same? While I apply the same scope box for 2 Plan views.
Guessing one is a plan and the other a ceiling plan. That mirrors the coordinate system.
they are all floor plans. I reversed XY from bounding box of the blue one to specify them.
I got the problem now. Because I move the view crop instead of editing it. So its camera position was moved. That’s why it can’t match with the other anymore.
By the way, How can we get the Camera position of a view?
Thank you! I got the problem.