Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66715

How do I determine if the active view is being accessed through a sheet view

$
0
0

I'm working my way through the Revit API's (and yes, I've studied the samples in the SDK and done the walk throughs and chased around many, many support pages and so-called help files trying to wrap my head around this convoluted mess).

I'm currently playing with a utility to renumber the views on a sheet. There will be many issues to resolve and things to figure out along the way of course but... I'm already stuck trying to determine one simple and very basic condition:

 

My goal is to determine if the user has a sheet view open. If a sheet view is open but the user has a viewport active, I would like to deactivate the viewport and proceed with the function upon the sheet view itself.

 

ExternalCommandData returns access to the application (from which you can get the active document and the actual application interface) as well as returning the view that is active when the user launched the tool.

 

I can easily determine if the active view is a sheet view or not... as long as the user doesn't have a view on the sheet in active edit mode, in which case the view that gets returned is the view represented by that active viewport (I know using viewport in context of the Revit API for this is incorrect, but it's the best terminology I can come up with, us old CAD guys have terms stuck in our heads from long term association and even the help files use it so I'm gonna run with it).

 

Even if I were to use the properties of that active view to determine if it was placed on a sheet, there is no way to determine if that sheet is open in the editor (a potential hack that I thought of) because the UIDocument..::..GetOpenUIViews Method will return the activated viewport, not the open sheet itself... from the remarks in the help file:

 

Remarks

A sheet view with an activated viewport will return the view associated with the activated viewport, not the sheet view.
 
 
So... how do I determine the actual sheet view that the user has open in the UI in this case?
 

Viewing all articles
Browse latest Browse all 66715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>