For starters, I discorage you to switch to cpython in RSA dynamo, as I stated on my quickstart guide and other posts in here.
But if you insist on switching, here are my impressions:
For the comObject error, you can use the ComObj class I reported here;
Your second attempt, as well as most of your code, smells like c# code poorly translated into python.
Usually words that starts with I
are interfaces (think of them as an API documentation), not conctete classes; we don’t do that here (in python)
The error you see is because you’re trying to get the CodeResults
from the IRDimDetailedRes
interface instead of RdmCodeRes
.
I suppose that lines like
RDmAllRes = IRDimAllRes(RDmEngine.Results())
work because they perform a cast of the object, but I think it’s unnecessary and can be rewritten as
(Also I would use camelCase, with lowercase first letter, or better yet snake_case for variables names as opposed to PascalCase for classes names)
all_results = RDmEngine.Results()
You also don’t need to “declare” the variables with their type/interface, lines like
RDmCodeRes = Object
Are totally useless.