# Remove WireSize from Dynamo Python

**URL:** <https://forum.dynamobim.com/t/remove-wiresize-from-dynamo-python/72448>\
**Category:** Developers\
**Tags:** revit, python, dynamo\
**Created:** [January 20, 2022, 3:40am UTC](https://forum.dynamobim.com/t/remove-wiresize-from-dynamo-python/72448 "2022-01-20T03:40:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jguevara5PPA8](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@jguevara5PPA8](https://forum.dynamobim.com/u/jguevara5PPA8)\
**Post date:** [January 20, 2022, 3:40am UTC](https://forum.dynamobim.com/t/remove-wiresize-from-dynamo-python/72448/1 "2022-01-20T03:40:18Z")

</div>

Hello everyone I do not know if you could advise me, I need to remove some wiring size based on the TemperatureRating and WireMaterial. I know that the way to eliminate them is using the RemoveWireSize method from the TemperatureRatingType class and I asked as an argument a wiring size to be able to Remove them, what I have been able to do so far is to get the list of wiring sizes that I want to eliminate, but I have not been able to unwrapping, please check the code down below thanks.

```auto
import clr
import sys
import System
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB.Electrical import *
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
# Import Dynamo RevitNodes
clr.AddReference("RevitNodes")
import Revit #Enable namespace typing
from Revit.Elements import *
clr.ImportExtensions(Revit.Elements) # ToDSType(bool) extension method
clr.ImportExtensions(Revit.GeometryConversion)# Import ToProtoType(), ToRevitType() extension methods
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
#Internal Definition (all custom defined functions to be in this region)
def ToList(input):
    if isinstance(input, list):
        return input
    else:
        return [input]
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
wiretype = UnwrapElement(IN[0])
result = []

#TransactionManager.Instance.EnsureInTransaction(doc)
#Main codes to be within this region
for i in wiretype:
    tempRating = i.TemperatureRating
    wireMaterial = i.WireMaterial
    Wiresizes = tempRating.WireSizes
    for ws in Wiresizes:
        foundWS = [ws.Size, ws.Ampacity, ws.Diameter]
        if ws.Size != "2000":
        	Remsz = ws.GetType()
        	Rem = tempRating.RemoveWireSize(Remsz)
        	result.append(Rem)
#End of region
#TransactionManager.Instance.TransactionTaskDone()
#TransactionManager.Instance.ForceCloseTransaction()

        

OUT = result

```

![Screenshot 2022-01-19 213948](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/7/d7890cc1f0b913450d5ea794a5a223b2402b25c9.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [January 20, 2022, 2:47pm UTC](https://forum.dynamobim.com/t/remove-wiresize-from-dynamo-python/72448/2 "2022-01-20T14:47:37Z")

</div>

Just from reading through the API I’m not sure you need `Remsz = ws.GetType()`. The `RemoveWireSize()` method takes a `WireSize` argument which you should already have with `ws`.
