Howdy All,
I am attempting to slice a list in python. I have achieved what I want in revit python shell.
But when I transfer the code to revit. It throws an error saying exp int, got slice. Does revit python editor not interpret the code the same way?
import clr
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
doc = DocumentManager.Instance.CurrentDBDocument
part = UnwrapElement(IN[0])
cnt = UnwrapElement(IN[1])
lst = [part]
for i in lst:
num = i[(cnt - cnt)::(cnt)]
num1 = i[((cnt + 1) - cnt)::(cnt)]
num2 = i[((cnt + 2) - cnt)::(cnt)]
num3 = i[((cnt + 3) - cnt)::(cnt)]
num4 = i[((cnt + 4) - cnt)::(cnt)]
OUT = num