Looks like it should work, I just checked the code and it should upcast the object properly to TriObj if its ClassID is ::Class_ID( TRIOBJ_CLASS_ID, 0 ) or PolyObject for ::Class_ID( POLYOBJ_CLASS_ID, 0 ).
Can you please check the ClassID returned by the object you're trying to cast (ie. provide me with value of node.EvalWorldState(0, true).Obj.ConvertToType(0, global.PolyObjectClassID).ClassID.PartA and PartB)?
Thanks
Marsel Khadiyev (Software Developer, EPHERE Inc.)