# Create System types, how?

**URL:** <https://forum.dynamobim.com/t/create-system-types-how/94869>\
**Category:** Developers\
**Created:** [October 24, 2023, 7:46pm UTC](https://forum.dynamobim.com/t/create-system-types-how/94869 "2023-10-24T19:46:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [October 24, 2023, 7:46pm UTC](https://forum.dynamobim.com/t/create-system-types-how/94869/1 "2023-10-24T19:46:00Z")

</div>

Hello,

i have some issue to create systemtimes… for each class i want a system, but i stuck

```auto
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.DB.Mechanical import *
from Autodesk.Revit.DB.Plumbing import *
import System

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

_sys = System.Enum.GetValues(MEPSystemClassification)

_sysTypes = FilteredElementCollector(doc).OfClass(MEPSystemType)
_class = [x.SystemClassification for x in _sysTypes]
_names = [Element.Name.GetValue(x) for x in _sysTypes]

t = TransactionGroup(doc, "Create SystemTypes")

t1 = Transaction(doc,"SupplyAir")
t1.Start()
systClass = MEPSystemClassification.SupplyAir
nst = Mechanical.MechanicalSystemType.Create(doc, systClass, "SUPPLYAIR")
t1.Commit()

t2 = Transaction(doc,"Sanitary")
t2.Start()
systClass = MEPSystemClassification.Sanitary
nst = Plumbing.PipingSystemType.Create(doc, systClass, "SANITARY")
t2.Commit()

t.Commit()

OUT = "done"

```

thats the error that i get

- Warnung:IronPythonEvaluator.EvaluateIronPythonScript fehlgeschlagen.\*  
_Traceback (most recent call last):_
- File “”, line 42, in \*  
_AttributeError: ‘Autodesk.Revit.UI.Mechanical’ object has no attribute ‘MechanicalSystemType’_

KR

Andreas

---

<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:** [October 24, 2023, 8:17pm UTC](https://forum.dynamobim.com/t/create-system-types-how/94869/2 "2023-10-24T20:17:00Z")

</div>

Your error message states that it’s trying to use the `Autodesk.Revit.UI` namespace instead of the `Autodesk.Revit.DB` namespace. This is because you have multiple references using `Mechanical`. You can either remove the `RevitAPIUI` reference since you don’t need it or you can import the system namespaces as named references and call them directly.

```auto
import Autodesk.Revit.DB.Mechanical as MechanicalDB
MechanicalDB.MechanicalSystemType.Create()

```

Also, make sure you transaction group has been started.
