New to RhinoCommon and plugins

Going through the new Developer Documents and I must say they are great. My coding skills up to now, are confined to front-end web and some python with Rhino. I have installed Xamarin on my Mac & VisualStudio 2015 Community on my PC. I am going through the samples here on the wiki.

My first question is, should I be learning C# for this, if I want to work cross-platform on a plugin idea?

Second, what is the best way to use the RhinoCommon SDK info, For now I am trying to write a command that sets layers for a specific situation. So I would look at Layer Table Members? This is just a test project for me to keep it simple. How commands are bundled together for a plugin is for later.

Third, does it matter if i start in Xamarin / Mono on my Mac and then convert to Windows, or is it better to start in VisualStudio. I know RhinoCommon is more Windows based, but will it make a difference doing it one way or the other, if I follow the Cross-Platform steps?

I am still just going through all the documents and trying things. Any advice is appreciated.

1 Like

Hello @rhinorudi,
Welcome to the wonderful world of cross platform development! While I am by no means an expert on the topic, I can point you to some different resources.

Yes! While in theory .Net/Mono code can be written by a variety of languages, the current state of developing cross platform, compiled PLUGINS for Rhino would more or less force you to work in C# in both OSX and Windows. You can write python scripts that use RhinoCommon, but for making compiled plugins, you would need to go with C#. Of course, @dan and @stevebaer could correct me on this.

This all depends on what you want to do. A Rhino Document has several ā€˜Tables’ of objects, materials, layers, instance definitions, etc. You can go through the layers in the LayerTable and set the properties of each as you wish.

Have you seen this guide for your first cross platform plugin?

You have a great community of people at different stages of learning and developing. All have had similar questions as you are having, so don’t hold back!

Thanks @fraguada,

Yes, I have been going through those documents and the samples here.

I decided to try to work with one item, setting up my layers / sub-layers like I do anyway for all jobs, and this will keep me focused on learning the C# syntax. One step at a time :smile:

Thanks again, I won’t. It is a great community and great software.

You might also want to take a look at the alternative RhinoCommon SDK documentation that is still under development: http://developer.rhino3d.com/api/RhinoCommon/html/A7FBC69C.htm#

I think it is derived from the Rhino for Mac 5.1 release. I find this format more comfortable as it is similar to the one that is used by msdn https://msdn.microsoft.com/en-us/library/mt472912(v=vs.110).aspx

Thanks @fraguada, that is way better than http://4.rhino3d.com/5/rhinocommon/ though I will keep them both bookmarked for now.

I was here, Color Struct (System.Drawing) | Microsoft Learn last night looking for layer colour information. Thanks again!

Very nice topic. I am very intersted how this develops and how easy/hard it is to create a crossplatform plugin.

That page for colors is handy but most of the times I use color.fromargb(r, g, b)
https://msdn.microsoft.com/en-us/library/at1k42eh(v=vs.110).aspx

1 Like

Awesome! I’m really glad to hear you are making the leap into plugin development. I think, given your previous experience, it will be a (mostly) smooth transition. C# is a great language.

Thanks for the feedback on the new developer.rhino3d.com site. As I’m sure you’ve discovered, we’re still in the process of migrating over all the content from the old wiki, so it’s a little ā€œin flux.ā€ If you are still looking at the old samples, you might find the ones on the new site more up-to-date…@alain has been busy moving them across lately.

As you go through this learning process, please let us know what sorts of guides would have helped you understand a concept or problem. We’re pretty busy authoring samples and guides that presume you are already a plugin developer (trying to fill an obvious gap), but we’d really like to make sure that the guides are accessible and helpful to the broadest audience.

Thanks @dan C# does seem fairly intuitive, so I hope to struggle on. Most of this is on my own time for now.

I will do. I am just storyboarding / wireframing what I want and then taking one bite at a time.

Thanks for the link to the new samples. :smiley:

I got a question about crossplatform. I only see C# with the rhinocommon library. Does this mean it is not possible to make a crossplatform plugin in vb.NET?

Mono does support VB.NET, but Xamarin Studio does not.

http://www.mono-project.com/docs/about-mono/languages/visualbasic/

But most of the tools related to cross platform development around .NET/Mono are in C#. Plus, converting VB.NET project to C# isn’t all that difficult.

1 Like

Oke thanks dale.
I know it is not difficult. But it is a lot of work :wink:
Guess if I go crossplatform I chose the wrong language .