Message 1 of 2
CurrentUIDocument ShowElements() not working in Legend View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am working on a feature that allows the User to select an item from a list and then Open the OwnerView and zoom to the element using ShowElements. I have done this for many things in the past, but there are items this time that are in legends. When I attempt to use this on a Curve or Textbox placed in a Legend I get a popup: 'No Good view could be found'
Short clip showing it working in a FloorPlan, but not Legend view type.
This is simplified python from Dynamo to show the issue in the video.
#Sean Page, 2024
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('System')
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp=DocumentManager.Instance.CurrentUIApplication
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
element = UnwrapElement(IN[0])
TransactionManager.Instance.EnsureInTransaction(doc)
TransactionManager.Instance.TransactionTaskDone()
OUT = DocumentManager.Instance.CurrentUIDocument.ShowElements(element.Id)
Is there something I am missing here? I also attempted to use ZoomAndCenteRectangle() but it would not Zoom, however it did at least center the item.