Is forbidden during iterating

is forbidden during iterating

Try removing the ‘sizes’ input from the call, as the method appears to only require two inputs - the standard name and the diameter.

Also, you have to call RemoveSizes on the ConduitSizeSettings instance not the type:

sizes.RemoveSizes(…

1 Like


:smiling_face_with_tear: :smiling_face_with_tear:
still have same problem

import clr
import sys
sys.path.append(‘C:\Program Files (x86)\IronPython 2.7\Lib’)
import System
clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference(‘RevitServices’)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
import System
from System.Collections.Generic import Dictionary

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument

sizetype =
nomsize =
outsize =
sizetype =
list =

sizes =Autodesk.Revit.DB.Electrical.ConduitSizeSettings.GetConduitSizeSettings(doc)

TransactionManager.Instance.EnsureInTransaction(doc)
x=
#OUT = dir(sizes)

Autodesk.Revit.DB.Electrical.ConduitSizeSettings.GetConduitSizeSettings(doc).RemoveSize(“eeee”,16)

TransactionManager.Instance.TransactionTaskDone()