Remove Item at index error in python


#1

using RemoveItemAtIndex in python gives me this error ??

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('DSCoreNodes')
import DSCore 
from DSCore.List import *

pts = IN[0]
out = []



OUT = DSCore.List.RemoveItemAtIndex(pts,1)

#2

Hi @fathygad

You can remove items in a list this way also:


#3

hi @Kulkul
thanx for this, however i need it to be inside as the index will be get by for loop inside Python script , i tried list.pop(index) and get the new list but it didn’t fulfill my need.


#4

Can you show me screenshot of your list and what type of result you would like to get.