Did anyone else also encountered this issue while Changing TypeId using method ChangeTypeId
being retured with a warning as shown below:
And at the same time if i change the engine it’ll execute perfectly, Weird??
so finally here if someone also bumped into the same, even found a unresolved thread as well seem quite old.
Hi,
In IronPython i used the following code to change an elementtype:
InGridList[NX].ChangeTypeId(RDB.ElementId(InGridType.Id))
This works fine no problems.
RDB for me is: import Autodesk.Revit.DB as RDB, NX in an index number to list.
In Cpython3 I get the following errormassage:
“No method matches given arguments for ChangeTypeId”
The API in not changed so the method most be there.
I added “RDB.ElementId(…)” to be sure the given type is an ElementId
The element i am working with is a …
Here is an example of the function in Cpython
NewFamily=Grid.Create(doc,anycurve)
if NewFamily:
GPI = NewFamily.GetType().GetMethod("ChangeTypeId")
GPI.Invoke(NewFamily, [ElementId(AnyGridType.Id)])
Create new family or existing.
Get the righte Method
Use an Invoke to execute the right methode
It works for me.
Hi @c.poupin & @b.vanderhoeven
This method worked like charm but @c.poupin still curious why the other overload isn’t working the one u mentioned in previous thread, here’s an implementation of it
It’s asking for doc, Icollection and ElementId. All 3 given so what did i miss…??
The second method is an static method
Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018
Oh yesssss…!!! @c.poupin Thankyou both the method working perfectly.
i missed that it was static Method, instead i was calling it as an Instance method.
Marked the solution
And glad to have this community.
2 Likes
SeanP
July 7, 2025, 8:19pm
7
I know this has been “solved” for a while, but I could not get this to work for me in R25 and the solution I found was to slightly modify the following line:
GPI.Invoke(person, [ElementId(types[i].Id)])
to this:
GPI.Invoke(person, [ElementId(types[i].Id.Value)])
2 Likes
FYI, it has been solved using the new PythonNet3 engine.
1 Like
SeanP
July 7, 2025, 9:58pm
9
Thanks @c.poupin , I been out of the Dynamo python game for a bit, but didn’t think to try the same idea within the normal method.
2 Likes