C++ For Rhino

I need some help regarding c++ coding. I have attached 2 simple pythons scripts, in which you can determine the maximum length of a surface, using boundingbox command.The main question is how to do the same thing in visual studio using C language, using the same structure? The task is to make a class in which many other functions are declared and can be used in any other .cpp files.Looked up on the web and found that one must declare the functions in header files (.h) and the definitions are in .cpp files, but I couldn’t make it work with the c++ Rhino SDK commands. I managed to make a console application where I made a simple function which outputs the sum of 2 numbers.
Also,I would also need some better documentation if any is available for the c++ sdk, because on the forums there are only samples with some commands. (Searching for something like python / rhinoscript help files).

Thank you in advance.


Here are the codes:


import rhinoscriptsyntax as rs

def LOA(srf):
#Returns the maximum length

length = rs.Distance(point0,point1)
return length


import rhinoscriptsyntax as rs
from LOA import*

obj = rs.GetObjects(“Pick surface”)
length = LOA(obj)
print length

You can find the C++ Samples repository here:

Specifically, here is an example that calculates the bounding box of objects.


Let me know if this helps.

Thank you for your reply.
Kind regards,

Is there any chance to make commands like rs.BoundingBox(srf) and to call them later in the program in c++? I know how to make commands, but I want to call them later.
For example: have a class named BoundingBox which creates a bbox), go to my main and call BoundingBox function, giving only the parameter, which in this case, is a surface.

Or is there any way to link rhinoscriptsyntax with C++?

Sorry, no.