Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Oct 28, 2024
1 parent d2cc208 commit 88e0b61
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nodes/3.x/python/Document.BuiltInCategories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
biclist = System.Enum.GetValues(BuiltInCategory)
cdata = []
for bic in biclist:
try: cdata.append((bic, ElementId(bic), Revit.Elements.Category.ById(ElementId(bic).IntegerValue)))
try: cdata.append((System.Enum.GetName(BuiltInCategory, bic), ElementId(bic), Revit.Elements.Category.ById(ElementId(bic).IntegerValue)))
except:
if not dynamoCatsOnly: cdata.append((bic, ElementId(bic), None))
OUT = map(list, zip(*cdata))
2 changes: 1 addition & 1 deletion nodes/3.x/python/Document.BuiltInParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
pdata = list()
for bip in bips:
try:
pdata.append((bip,ElementId(bip),LabelUtils.GetLabelFor(bip)))
pdata.append((System.Enum.GetName(BuiltInParameter, bip),ElementId(bip),LabelUtils.GetLabelFor(bip)))
except:
pass
OUT = pdata
3 changes: 1 addition & 2 deletions nodes/3.x/python/Document.ElementClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
import System.Reflection
import System.AppDomain
import System

rAssembly = [x for x in System.AppDomain.CurrentDomain.GetAssemblies() if x.GetName().Name == 'RevitAPI'][0]
rElement = [x for x in rAssembly.GetTypes() if x.Name == 'Element' and x.Namespace == 'Autodesk.Revit.DB'][0]
Expand Down
2 changes: 1 addition & 1 deletion nodes/3.x/python/Document.Enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
import Autodesk

rAssembly = [x for x in System.AppDomain.CurrentDomain.GetAssemblies() if x.GetName().Name == 'RevitAPI'][0]
OUT = [x.Name for x in rAssembly.GetTypes() if x.Namespace is not None and x.Namespace.startswith("Autodesk.Revit.") and x.BaseType == System.Enum]
OUT = [x.Name for x in rAssembly.GetTypes() if x.Namespace is not None and x.Namespace.startswith("Autodesk.Revit.") and str(x.BaseType) == "System.Enum"]
OUT = sorted(OUT, key=str.lower)
2 changes: 1 addition & 1 deletion nodes/3.x/python/Enum.Values.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rAssembly = [x for x in System.AppDomain.CurrentDomain.GetAssemblies() if x.GetName().Name == 'RevitAPI'][0]

def GetEnumValues(typename):
foundenums = [x for x in rAssembly.GetTypes() if x.Name == typename and x.BaseType == System.Enum]
foundenums = [x for x in rAssembly.GetTypes() if x.Name == typename and str(x.BaseType) == "System.Enum"]
try:
enumnames = foundenums[0].GetEnumNames()
enumvals = [int(System.Enum.Parse(foundenums[0], x)) for x in enumnames]
Expand Down
3 changes: 2 additions & 1 deletion nodes/3.x/python/View.DetailLevel.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import clr
import System
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

def DetailLevel(view):
if hasattr(view, "DetailLevel"): return str(view.DetailLevel)
if hasattr(view, "DetailLevel"): return System.Enum.GetName(ViewDetailLevel, view.DetailLevel)
else: return None

views = UnwrapElement(IN[0])
Expand Down
3 changes: 2 additions & 1 deletion nodes/3.x/python/View.Type.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import clr
import System
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

def GetViewType(view):
if hasattr(view, "ViewType"): return str(view.ViewType)
if hasattr(view, "ViewType"): return System.Enum.GetName(ViewType, view.ViewType)
else: return None

views = UnwrapElement(IN[0])
Expand Down

0 comments on commit 88e0b61

Please sign in to comment.