diff --git a/nodes/3.x/python/Document.ProjectParameters.py b/nodes/3.x/python/Document.ProjectParameters.py index c4c2733c..4d08df92 100644 --- a/nodes/3.x/python/Document.ProjectParameters.py +++ b/nodes/3.x/python/Document.ProjectParameters.py @@ -20,7 +20,6 @@ elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.Document": doc = inputdoc else: doc = None -version = IN[2] names = [] cats = [] @@ -37,14 +36,8 @@ while iterator.MoveNext(): vag.append(iterator.Key.VariesAcrossGroups) names.append(iterator.Key.Name) - if version > 2021: - pts.append(iterator.Key.GetDataType()) - uts.append(iterator.Key.GetDataType()) - pgs.append(iterator.Key.GetGroupTypeId()) - else: - pts.append(iterator.Key.ParameterType) - uts.append(iterator.Key.UnitType) - pgs.append(iterator.Key.ParameterGroup) + pts.append(iterator.Key.GetDataType()) + pgs.append(iterator.Key.GetGroupTypeId()) isvis.append(iterator.Key.Visible) elem = doc.GetElement(iterator.Key.Id) elems.append(elem) @@ -64,7 +57,7 @@ # Return null if category is not supported by Dynamo # This way the user knows there are unsupported categories assigned thesecats.append(None) - builtincats.append(System.Enum.ToObject(BuiltInCategory, cat.Id.IntegerValue)) + builtincats.append(System.Enum.GetName(BuiltInCategory, cat.Id.IntegerValue)) cats.append(thesecats) bics.append(builtincats) -OUT = (names,cats,vag, pgs, pts, uts, isvis, elems, guids, isinst, bics) \ No newline at end of file +OUT = (names,cats,vag, pgs, pts, isvis, elems, guids, isinst, bics) \ No newline at end of file diff --git a/nodes/3.x/python/Document.ProjectParametersByCategory.py b/nodes/3.x/python/Document.ProjectParametersByCategory.py index 3b7b14e9..420ace9f 100644 --- a/nodes/3.x/python/Document.ProjectParametersByCategory.py +++ b/nodes/3.x/python/Document.ProjectParametersByCategory.py @@ -40,7 +40,6 @@ elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.Document": doc = inputdoc else: doc = None -version = IN[3] iterator = doc.ParameterBindings.ForwardIterator() while iterator.MoveNext(): @@ -50,14 +49,8 @@ if cat.Id.IntegerValue == search_id: names[i].append(iterator.Key.Name) vag[i].append(iterator.Key.VariesAcrossGroups) - if version > 2021: - pts[i].append(iterator.Key.GetDataType()) - uts[i].append(iterator.Key.GetDataType()) - pgs[i].append(iterator.Key.GetGroupTypeId()) - else: - pts[i].append(iterator.Key.ParameterType) - uts[i].append(iterator.Key.UnitType) - pgs[i].append(iterator.Key.ParameterGroup) + pts[i].append(iterator.Key.GetDataType()) + pgs[i].append(iterator.Key.GetGroupTypeId()) isvis[i].append(iterator.Key.Visible) elem = doc.GetElement(iterator.Key.Id) elems[i].append(elem) @@ -68,5 +61,5 @@ isinst[i].append(True) else: isinst[i].append(False) i += 1 -if isinstance(IN[0], list): OUT = (names, vag, pgs, pts, uts, isvis, elems, guids, isinst) -else: OUT = (names[0], vag[0], pgs[0], pts[0], uts[0], isvis[0], elems[0], guids[0], isinst[0]) \ No newline at end of file +if isinstance(IN[0], list): OUT = (names, vag, pgs, pts, isvis, elems, guids, isinst) +else: OUT = (names[0], vag[0], pgs[0], pts[0], isvis[0], elems[0], guids[0], isinst[0]) \ No newline at end of file diff --git a/nodes/3.x/python/Family.PlacementType.py b/nodes/3.x/python/Family.PlacementType.py index c0387cc9..591f1d77 100644 --- a/nodes/3.x/python/Family.PlacementType.py +++ b/nodes/3.x/python/Family.PlacementType.py @@ -1,9 +1,10 @@ import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * +import System def GetPlacementType(item): - if hasattr(item, "FamilyPlacementType"): return item.FamilyPlacementType + if hasattr(item, "FamilyPlacementType"): return System.Enum.GetName(FamilyPlacementType, item.FamilyPlacementType) else: return None items = UnwrapElement(IN[0]) diff --git a/nodes/3.x/python/Level.Views.py b/nodes/3.x/python/Level.Views.py index c9937fa6..f74cb970 100644 --- a/nodes/3.x/python/Level.Views.py +++ b/nodes/3.x/python/Level.Views.py @@ -6,18 +6,21 @@ import Revit clr.ImportExtensions(Revit.Elements) +import System +from System.Collections.Generic import * + +def GetFirstAndAllViews(lvl): + firstView = None + try: + if lvl.Document.GetElement(lvl.FindAssociatedPlanViewId()): firstView = lvl.Document.GetElement(lvl.FindAssociatedPlanViewId()) + except: pass + if viewlevels.Contains(lvl.Id): allViews = views[viewlevels.IndexOf(lvl.Id)] + else: allViews = [] + return firstView, allViews + levels = UnwrapElement(IN[0]) -version = IN[1] -elementlist = list() -for lvl in levels: - if version > 2017: - try: - if lvl.Document.GetElement(lvl.FindAssociatedPlanViewId()) == None: - elementlist.append(None) - else: - elementlist.append(lvl.Document.GetElement(lvl.FindAssociatedPlanViewId())) - except: - elementlist.append(None) - else: - elementlist.append(None) -OUT = elementlist \ No newline at end of file +views = UnwrapElement(IN[1]) +viewlevels = List[ElementId]([x.Id for x in UnwrapElement(IN[2])]) + +if isinstance(IN[0], list): OUT = list(zip(*[GetFirstAndAllViews(x) for x in levels])) +else: OUT = GetFirstAndAllViews(levels) \ No newline at end of file