diff --git a/nodes/3.x/python/FileSystem.FileSize.py b/nodes/3.x/python/FileSystem.FileSize.py index db2c5a4f..a4acff35 100644 --- a/nodes/3.x/python/FileSystem.FileSize.py +++ b/nodes/3.x/python/FileSystem.FileSize.py @@ -1,5 +1,5 @@ import clr -import System.IO.FileInfo +import System.IO def GetFileSize(file): if str(file.GetType()) == "System.IO.FileInfo": diff --git a/nodes/3.x/python/RandomList.AsIntegers.py b/nodes/3.x/python/RandomList.AsIntegers.py index 9c01e040..23bed0af 100644 --- a/nodes/3.x/python/RandomList.AsIntegers.py +++ b/nodes/3.x/python/RandomList.AsIntegers.py @@ -1,5 +1,5 @@ import clr -import System.Random +import System min = IN[0] max = IN[1] diff --git a/nodes/3.x/python/System.CPUs.py b/nodes/3.x/python/System.CPUs.py index 415ee92c..b2a925b1 100644 --- a/nodes/3.x/python/System.CPUs.py +++ b/nodes/3.x/python/System.CPUs.py @@ -3,11 +3,11 @@ from System.Management import ManagementObject, ManagementObjectSearcher sysinfo = ManagementObjectSearcher("Select NumberOfProcessors, NumberOfLogicalProcessors from Win32_ComputerSystem").Get() for sysdata in sysinfo: - physicalProcessors = sysdata.Item["NumberOfProcessors"] - logicalProcessors = sysdata.Item["NumberOfLogicalProcessors"] + physicalProcessors = sysdata.get_Item("NumberOfProcessors") + logicalProcessors = sysdata.get_Item("NumberOfLogicalProcessors") sysinfo = ManagementObjectSearcher("Select NumberOfCores, MaxClockSpeed from Win32_Processor").Get() cores = 0 for sysdata in sysinfo: - cores += sysdata.Item["NumberOfCores"] - cpuspeed = sysdata.Item["MaxClockSpeed"] + cores += sysdata.get_Item("NumberOfCores") + cpuspeed = sysdata.get_Item("MaxClockSpeed") OUT = (physicalProcessors, logicalProcessors, cores, float(cpuspeed)/1000) \ No newline at end of file diff --git a/nodes/3.x/python/System.Memory.py b/nodes/3.x/python/System.Memory.py index 4eb3214b..c8c67b6d 100644 --- a/nodes/3.x/python/System.Memory.py +++ b/nodes/3.x/python/System.Memory.py @@ -5,9 +5,9 @@ sysinfo = ManagementObjectSearcher("Select Capacity from Win32_PhysicalMemory").Get() installedMem = 0 for sysdata in sysinfo: - installedMem += sysdata.Item["Capacity"] + installedMem += sysdata.get_Item("Capacity") sysinfo = ManagementObjectSearcher("Select FreePhysicalMemory from Win32_OperatingSystem").Get() for sysdata in sysinfo: - freeMem = sysdata.Item["FreePhysicalMemory"] + freeMem = sysdata.get_Item("FreePhysicalMemory") procMem = Process.GetCurrentProcess().WorkingSet64 OUT = (float(installedMem)/1073741824, float(freeMem)/1048576, float(procMem)/1073741824) \ No newline at end of file diff --git a/nodes/3.x/python/TimeSpan.EvaluateLapTimes.py b/nodes/3.x/python/TimeSpan.EvaluateLapTimes.py index 8de0ca6e..78f60262 100644 --- a/nodes/3.x/python/TimeSpan.EvaluateLapTimes.py +++ b/nodes/3.x/python/TimeSpan.EvaluateLapTimes.py @@ -1,2 +1,3 @@ import clr -OUT = [x - y for x, y in zip(IN[0][1:], IN[0][:-1])], IN[0][-1]-IN[0][0] \ No newline at end of file +from System import DateTime +OUT = [x.Subtract(y) for x, y in zip(IN[0][1:], IN[0][:-1])], IN[0][-1].Subtract(IN[0][0]) \ No newline at end of file diff --git a/nodes/3.x/python/VersionNumber.Compare.py b/nodes/3.x/python/VersionNumber.Compare.py index bffffed0..cf0a18f3 100644 --- a/nodes/3.x/python/VersionNumber.Compare.py +++ b/nodes/3.x/python/VersionNumber.Compare.py @@ -3,8 +3,8 @@ from System import Version if isinstance(IN[0], list): - if isinstance(IN[1], list): OUT = [x.CompareTo(y) for x,y in zip(IN[0], IN[1])] - else: OUT = [x.CompareTo(IN[1]) for x in IN[0]] + if isinstance(IN[1], list): OUT = [Version(x).CompareTo(Version(y)) for x,y in zip(IN[0], IN[1])] + else: OUT = [Version(x).CompareTo(Version(IN[1])) for x in IN[0]] else: - if isinstance(IN[1], list): OUT = [IN[0].CompareTo(x) for x in IN[1]] - else: OUT = IN[0].CompareTo(IN[1]) \ No newline at end of file + if isinstance(IN[1], list): OUT = [Version(IN[0]).CompareTo(Version(x)) for x in IN[1]] + else: OUT = Version(IN[0]).CompareTo(Version(IN[1])) \ No newline at end of file diff --git a/nodes/3.x/python/Wall.Orientation.py b/nodes/3.x/python/Wall.Orientation.py index 052cd21c..44818652 100644 --- a/nodes/3.x/python/Wall.Orientation.py +++ b/nodes/3.x/python/Wall.Orientation.py @@ -17,7 +17,7 @@ def WallOrientation(wall): if flipped: return wall.Orientation.ToVector().Reverse() else: return wall.Orientation.ToVector() else: - direction = (lcurve.GetEndPoint(1) - lcurve.GetEndPoint(0)).Normalize() + direction = (lcurve.GetEndPoint(1).Subtract(lcurve.GetEndPoint(0))).Normalize() if flipped: return XYZ.BasisZ.CrossProduct(direction).ToVector().Reverse() else: return XYZ.BasisZ.CrossProduct(direction).ToVector() else: return None