2: After that I have to get backgroundstyle of “Shaded” displaymode.
I stuck here.
I searched rhinocommon online and tried a few ways. None of them asked for some input or parameter related to “shaded”. They are all somehow “global” settings.
Hello Mahdiyar.
Your code is really helpful.
I am sorry to bother but still I have a question about overall C# development.
I found the “GetFill” in rhinocommon as link below: Rhinocommon GetFill page
My question is how does one find the correct structure of Rhinocommon. I found the document quite unclear in structure, and with new Rhino 7 API changed a lot, online Rhinocommon is missing information in many pages.
Even in Rhino 6, Rhinocommon’s quality is a little poor for a standard developer document.
The link below is FFMpeg online document page: FFMpeg online document
Comparing to the FFMpeg document, Rhinocommon is missing so many examples and basic workflow of the whole structure, difficult for developpers to find the command they need. In this case I found it difficult to find the correct keyword “GetFill” on my own.
I am not to criticize Rhinocommon because it is basically decent document, where I can find most keywords if I am already familiar with the structure.
But still I think something is missing in my own workflow, or there is some special technich to deal with Rhinocommon.
Apologies for reviving the topic, but I can’t seem to get the code to return correct background colors while in GradientView. As far as I can tell the DisplayAttributes.GetFill method always return the same four colors (159,159,159 in my case) and the fillMode does not register either Gradient2Color or Gradient4Color. This is the case for both the latest Rhino 7 and Rhino 8 updates. Anyone have some nuggets of wisdom to share?
Hi Anders, I just tested the behavior you described in Rhino 8.16.24363, and everything seems to work as expected on my end. Here’s a quick screen recording of my test:
Cheers @Mahdiyar, that’s much appreciated. I was referring specifically to setting the background gradient using the GradientView command. I’ve been using that for a long time and think it might have been deprecated without me noticing (i.e. superseded by setting the gradient like you demonstrate in the video):
Edit: I just realised it sounds like I am still looking for a solution, but I’ll just stop using GradientView. Also. here’s a Python function that seems to work quite well for getting the upper left color (not taking bitmap backgrounds into account):