change color in Python
I would like to change the color of the object in the scene by python ...
All the following works very well ...
from blenderbim.bim.ifc import IfcStore
obj = IfcStore.get_element("some_guid")
obj.type
obj.name
obj.hide_set(True) # hide
obj.hide_set(False) # show
obj.visible_get() # get visibility
obj.select_set(True) # select
obj.select_set(False) # unselect
but with this nothing happens to the object ...
obj.color = [1.0, 1.0, 0.0, 1]
Am I missing something ?
Comments
Maybe it's working, but you are not seeing, check if Viewport Shading color is set to "Object". You can also inspect in Object Properties > Viewport Display:

I knew how to do this by gui. I would like to change the color of an object in the scene view by python.
Ahh got you point ... open the Viewport Shading Dialog and switch from Material to Object and be happy with the changed color
works great :-)
Which results in the next question. How can this Viewport shading color be switched to object by Python?
The short answer would be:
It gets trickier if you have more than one viewport and would like to change just a specific one
works great here ... :-)
Thus ... If I switch from BIM to scripting copy the code it changes the viewport above Python widget, but not the main viewport if switch back to BIM. I am fine with this ATM :-)
You can query viewports in all the workspaces at once :