Within Inventor's API (iLogic), please update the coding behind the DrawingViews object for its Item() property, so we can either specify the drawing view's name OR specify its index number. Right now you can only specify an Integer there for its index, which is often practically useless, which leads to needing to loop through Each DrawingView in DrawingViews, checking the Name property of each, until we find the one with the name we're looking for. This simple little change would make many scenarios much easier, and require a lot less code. After many years of iLogic/VBA coding with Inventor, I can't really think of any reason why this might not be possible to set-up, or would cause any problems.
I want to be able get a specific DrawingView like this:
oView = oDrawingViews.Item("VIEW1")
instead of like this:
oView = oDrawingViews.Item(3)
I know there is an iLogic snippet for specifying a view by its name,
oView = ActiveSheet.View("VIEW1").View
But that uses the ActiveSheet (ThisRule.ActiveSheet) object (which is an IManagedSheet Interface), then an iManagedDrawingView Interface , then finally a regular DrawingView object, but this only works with the 'active' sheet. This assumes too much, and I generally don't like to use it, especially in an external rule that is processing many different drawing documents.