C++ For Rhino

Hello,
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.

Navyk

Here are the codes:

LOA.py

import rhinoscriptsyntax as rs

def LOA(srf):
#Returns the maximum length

rs.EnableRedraw(False)
BBox=rs.BoundingBox(srf)
point0=BBox[0]
point1=BBox[1]
length = rs.Distance(point0,point1)
return length

Main.py

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.

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleCommands/cmdSampleBoundingBox.cpp

Let me know if this helps.

Thank you for your reply.
Kind regards,
Tudor

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.