ChangeTypeId Having issue with CPython3 Engine...?

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?? :thinking:
so finally here if someone also bumped into the same, even found a unresolved thread as well seem quite old.

Hi,

see this topic

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

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