pyrevitlabs/pyRevit

show view range - match view extents

RevitIRL opened this issue · 14 comments

Is your feature request related to a problem? Please describe

Trying to show users visually what is in a plan view

Describe the solution you'd like

Color planes should match what's shown in the view (not the extents of Level1)

Describe alternatives you've considered

grin & bear it :)

Additional context

It was intentional to use the level, because calculating a views outline can be tricky if it is not cropped. An alternative could be to use the view's outline if it is croped but fallback to the level's if it is not.

I'd prefer that method - and that's what I would expect (using the view's Associated Level if no Crop Region).

from the other thread:
maybe you could get the bounding box of the view instead? [though it would be nice,] If it's not precisely the outline of the crop region, that's fine (i.e. it can be rectangular), but sometimes our level is huge, but the plan view is smaller

The extents of the crop is easy. If there is no crop the extents has to be calculated from the complete model and that is quite expensive.

I've changed the code to use the views extents. Do we need the level's extents as a fallback, or should the UI warn about turning on the crop? I think the different behaviour for uncropped views can be confusing without explanation, and most of the views are cropped anyway.
Thoughts? @RevitIRL @jmcouffin

@thumDer I'd go for the warning IMHO

I've also realized that I would need to combine that pre-check/warning with the 3d view's sectionbox check, because if the 3d view has a section box the script will use its extents for the planes, and the levels were only a fallback. So now the crop will be a fallback, and if there is none the warning will ask the user to turn on the section box OR the crop. Deal?

@thumDer deal
One thing I noticed is that in the Revit sample house (imperial) the plans are offset up by the inverse of the project base point vertical displacement

@jmcouffin Interesting. I don't have the imperial sample house right know, could you send it over to me somehow?

@jmcouffin Interesting. I don't have the imperial sample house right know, could you send it over to me somehow?

https://drive.google.com/file/d/1Vj5GuygVbzUShW91LJtvIp-ACSj20tkc/view?usp=sharing

thanks, already fixed by 5ddd651
we always have our PBP at our internal origin, so never came accross this difference, but nice catch!

shall we close the issue?

That fix I comitted is only for the elevation issue, I still need some time to finalize to crop based extents, only slight adjustments, safeguard mechanisms.

done. should we close this manually or let it close itself on next release?

Manually, that makes me feel better to see the number of issues going down, that's me liking things tidy🤭