# CPython method overloading problems (Dynamo 2.10 & Python3)

**URL:** <https://forum.dynamobim.com/t/cpython-method-overloading-problems-dynamo-2-10-python3/71917>\
**Category:** Developers\
**Tags:** revit, python, api\
**Created:** [January 3, 2022, 1:02pm UTC](https://forum.dynamobim.com/t/cpython-method-overloading-problems-dynamo-2-10-python3/71917 "2022-01-03T13:02:42Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![IvanPajares](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ivanpajares/32/129504_2.png) [@IvanPajares](https://forum.dynamobim.com/u/IvanPajares)\
**Post date:** [January 3, 2022, 1:02pm UTC](https://forum.dynamobim.com/t/cpython-method-overloading-problems-dynamo-2-10-python3/71917/1 "2022-01-03T13:02:42Z")

</div>

Hi folks,

I’m having trouble using method overloading when using the CPython engine in Dynamo 2.10  
Please check the following code to create a schema and place an instance of it in an element in the model.  
It works just fine in IronPython but crashes in CPython (I skip the import block for brevity):

```auto
component = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

def create_schema():
    schema_guid = System.Guid("DF3BBCC1-4D4D-4A01-B444-F9722814F9CE")
    schema_builder = SchemaBuilder(schema_guid)
    schema_builder.SetReadAccessLevel(AccessLevel.Public)
    schema_builder.SetWriteAccessLevel(AccessLevel.Public)
    schema_builder.SetSchemaName("TestSchema")
    schema_builder.SetDocumentation("Test schema to store ids")
    field_builder = schema_builder.AddSimpleField("ParentComponentID", System.String)
    schema = schema_builder.Finish()
    return schema

def add_schema_instance(schema, rvt_element):
    field = schema.GetField("ParentComponentID")
    schema_instance = Entity(schema)
    schema_instance.Set[System.String](field, "ID0004")
    rvt_element.SetEntity(schema_instance)
    

TransactionManager.Instance.TransactionTaskDone()

schema = create_schema()

```

When I try to port it to CPython, this same code crashes with exception

> Warning: TypeError : No method matches given arguments for Set: (\<class ‘Autodesk.Revit.DB.ExtensibleStorage.Field’\>, \<class ‘str’\>)

I have tried different permutations and no overloading like

```auto
schema_instance.Set(field, "ID0004")

```

But nothing seems to work…

What is the new syntax for method overloading when using CPython with Dynamo?

Thanks in advance and happy 2022 everyone!

---

_[View the full topic](https://forum.dynamobim.com/t/cpython-method-overloading-problems-dynamo-2-10-python3/71917)._
