Hey
I am trying locate the plan in which an element is skecthed(not originally my project) so I am trying to locate the owning view to a floor element.
I am using a python script of the element to get the property OwnerViewId and it is returning the number -1. I also tried selecting different elements which I know what plan they are on.
Any reason why I am getting this result? Any other suggested way to find the plan?
import clr
import sys
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
l = UnwrapElement(IN[0])
OUT = l.OwnerViewId