Object Type in Python

Hi All,

is there a way to show the object type with a Python Script?

You can use .GetType() like this:
IN[0].GetType()

3 Likes

Thanks @T_Pover I have been curious about this as well.

Although I am still not sure why you get different results running within Dynamo Vs (IronPythonConsole or RevitPythonShell)
I guess is the Dynamo treats the type representation method (repr) differently…?

1 Like

Thanks!

@T_Pover @Gui_Talarico

Can you provide a link where I can get more info regarding the following:

clr.GetPythonType(type(x))
clr.GetPythonType(type(x)).__name__
x.GetType()
clr.GetClrType(type(x))
clr.GetClrType(type(x)).ToString()

Thanks.

http://ironpython.net/documentation/dotnet/dotnet.html

2 Likes

That’s great info.
All I know is that the GetType() method is available for every object in the .NET framework :slight_smile:
https://msdn.microsoft.com/nl-nl/library/system.object.gettype(v=vs.110).aspx

1 Like