diff --git a/nodes/3.x/python/Category.Type.py b/nodes/3.x/python/Category.Type.py index a7887c19..2134db75 100644 --- a/nodes/3.x/python/Category.Type.py +++ b/nodes/3.x/python/Category.Type.py @@ -8,7 +8,7 @@ clr.ImportExtensions(Revit.Elements) def GetCategoryType(cat): - if hasattr(cat, "CategoryType"): return cat.CategoryType.ToString() + if hasattr(cat, "CategoryType"): return System.Enum.GetName(CategoryType, cat.CategoryType) else: return None cats = UnwrapElement(IN[0]) diff --git a/nodes/3.x/python/Door.Rooms.py b/nodes/3.x/python/Door.Rooms.py index 861dfb25..c37996a5 100644 --- a/nodes/3.x/python/Door.Rooms.py +++ b/nodes/3.x/python/Door.Rooms.py @@ -5,13 +5,9 @@ def GetRooms(item, phase): if hasattr(item, "FromRoom") and str(phase.GetType()) == "Autodesk.Revit.DB.Phase": exits = 0 - # Need to wrap this in try/except for doors/windows that don't exist in the given phase - try: - if item.FromRoom[phase]: exits += 1 - if item.ToRoom[phase]: exits += 1 - return item.FromRoom[phase], item.ToRoom[phase], exits - except: - return None, None, 0 + if item.get_FromRoom(phase): exits += 1 + if item.get_ToRoom(phase): exits += 1 + return item.get_FromRoom(phase), item.get_ToRoom(phase), exits else: return None, None, 0 items = UnwrapElement(IN[0]) diff --git a/nodes/3.x/python/Room.AtPointInPhase.py b/nodes/3.x/python/Room.AtPointInPhase.py index 43115903..a452dd20 100644 --- a/nodes/3.x/python/Room.AtPointInPhase.py +++ b/nodes/3.x/python/Room.AtPointInPhase.py @@ -11,10 +11,16 @@ import RevitServices from RevitServices.Persistence import DocumentManager -doc = DocumentManager.Instance.CurrentDBDocument points = IN[0] phase = UnwrapElement(IN[1]) -roomlist = list() -for pt in points: - roomlist.append(doc.GetRoomAtPoint(pt.ToXyz(),phase)) -OUT = roomlist \ No newline at end of file +inputdoc = UnwrapElement(IN[2]) +if inputdoc == None: + doc = DocumentManager.Instance.CurrentDBDocument +elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.RevitLinkInstance": + doc = inputdoc.GetLinkDocument() +elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.Document": + doc = inputdoc +else: doc = None + +if isinstance(IN[0], list): OUT = [doc.GetRoomAtPoint(x.ToXyz(),phase) for x in points] +else: OUT = doc.GetRoomAtPoint(points.ToXyz(),phase) \ No newline at end of file diff --git a/nodes/3.x/python/Schema.Properties.py b/nodes/3.x/python/Schema.Properties.py index 47b58c07..945e528e 100644 --- a/nodes/3.x/python/Schema.Properties.py +++ b/nodes/3.x/python/Schema.Properties.py @@ -1,4 +1,5 @@ import clr +import System clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * @@ -11,7 +12,7 @@ def SchemaProperties(schema): if hasattr(schema, "SchemaName"): - return schema.SchemaName, schema.VendorId, schema.GUID, schema.Documentation, schema.ApplicationGUID, str(schema.ReadAccessLevel), str(schema.WriteAccessLevel) + return schema.SchemaName, schema.VendorId, schema.GUID, schema.Documentation, schema.ApplicationGUID, System.Enum.GetName(ExtensibleStorage.AccessLevel, schema.ReadAccessLevel), System.Enum.GetName(ExtensibleStorage.AccessLevel, schema.WriteAccessLevel) else: return None, None, None, None, None, None, None if isinstance(IN[0], list): OUT = map(list, zip(*[SchemaProperties(x) for x in schemas]))