I am using VB.net and rhinocommon to develop a footwear plugin. I’m trying to figure out the best way to structure it as far as variables and so on…
One of the things the plugin does, for example, is to design a foot orthosis about a foot model. The orthosis is created in several steps (commands). First landmarks on the foot are located (in the form of rhino point objects), next the orthosis outline is created (curves), then the surface of the orthosis (surface), then the body of the orthosis (polysurface).
I need to keep track of these objects between commands that are run. A simple way I used to do this when using rhino script was to give the object a name (object properties) and then search for it via this name every time a script was run.
When I started developing in RhinoCommon, I got some advice, and tried to get a bit more advanced with this. I created a class called foot and another called orthotic and these had public properties such as foot.FirstBallJointID (a landmark on the foot as a rhino point object). I created public instances of the classes for left and right feet within a module so they would be maintained between running various commands. I also had properties that when called returned the geometry for the objects.
A problem with this method is that if my user saves the file and comes back later to work on it, a command has to be run that populates all the properties based on object names (similar to what I used to do for Rhino Scripting). So that gets me thinking I should have just stuck with that method in the first place… But perhaps it is slow to have to populate a lot of properties every time a command is run? And I need some variables that cannot be contained in Rhino Objects, like what gender the current subject is.
But probably the biggest problem though is that this structure is a bit difficult to understand. I will have other people working on it in the future and it has to be easily understood for someone coming from RhinoScript.
I don’t have an exact question here… perhaps the best way to help me would be to explain how you setup plugins for variables and how they are maintained between commands. And any general advice and thoughts in this area is appreciated!