Grasshopper

algorithmic modeling for Rhino

1,can i change the background color of view in C#script?

2,how to excute the "rhinoscript" in C#script?

thank you in advance,have a nice day!!!

Views: 2594

Replies to This Discussion

Hi Andrea

I'll tell you what I know:

  1. I don't think a way to change the background of the editor is currently exposed.
  2. C# does not have a rhinoscriptsyntax library. Of the languages running in Grasshopper, only Python has one.

I hope this helps,

- Giulio
__________________
giulio@mcneel.com

it seems to use python is a better choice.....Thank you Giulio!

Ciao Andrea

Rhino.ApplicationSettings.AppearanceSettings.ViewportBackgroundColor = Color.White;

This sets the background color to White.

You can use the AppearanceSettings class to set a few different things in the rhino viewport. look here

Hope this is something you can use.

Why do you need to execute a rhino script within c#?

Saluti Florian

Grazie,Florian

you are a italian?but your name seems to be no....

i have tried your code,it works,you are bravo!but i know this can be find in Rhinocommon,but how can you find the method...because there are a lot of things in Rhinocommon....

why?because i find that in python we can use the rhinoscript,so i ask whether it can be used in C#script.

Saluti

Si sono italiano, ma di madrelingua tedesca ;-)

I'm happy that it worked.  I do often use the keyword search function, if i don't get it from the folding menu bar on the left. In this case i typed "background color" and it showed up many different results such as viewport background color.

I know in the beginning it is a bit tricky to find something, but once you know where to find which type of class you're much faster. Also in Grasshopper the namespace is set to Rhino.Geometry. If you start typing "Rhino." you can access many other interesting classes, but i'm sure you already knew that.

saluti flo

Thank you for clear explanation!

Vielen danke!

L'ho capito!!Questo ha bisgno tanto tempo a imparlarlo.

Sorry guys, I had obviously misunderstood the first question. I thought it was about the background color of the C# script editor. Occasionally somebody asks about that, too. Thank you Florian for spotting this.

To continue the conversation about the RhinoScript library: everything that can be done in rhinoscriptsyntax in Python can be done also in RhinoCommon ("Rhino."). But my personal feeling is that often the brevity of Python, combined with the straightforwardness of the RhinoScript library are really convenient. You can see an example with all 3 RhinoCommon samples (Vb.net, C# and Python RhinoCommon) and one Python RhinoScript here, in that conversation by Arthur.

I hope this helps, and sorry again about my confusion at point 1.

Thanks,

- Giulio
________________
giulio@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service