What’s the best approach to building a script in a sense of structure and imports linkage?
Here’s what I mean: let’s say my program will use the ETO interface with which you can select Rhino objects, make different calculations, change different parameters with ETO widgets, and so on. As a result, a certain object should turn out, which will contain many variables and different data arrays. But this is not a Rhino object, i.e. not a surface, not a Mesh. It will just be a Python object with data (let’s call it XYZ Object). I also need that after closing the ETO window, this Python object remains in memory so that I can refer to it again if I re-run the ETO interface without having to reset all the parameters and recalculate everything again.
Let’s say I have a separate file with the ETO class, a separate file with the XYZ Object class, and a separate file with functions and calculation procedures for the XYZ Object.
My question is this: how is it better to build the overall structure?
For example, I can make the main running the ETO class file, and import the XYZ Object and all the functions into it. Then, what is the best way to do it: make the new XYZ Object Global, or as a variable of the ETO class (as in ETO Init: ~ self.this_XYZ_Object = import XYZ_Object)
My question may seem confusing, but I’m sure experienced programmers will understand what my problem is. Maybe there is a ready-made simple example with the use of ETO and several imports.
Thank you in advance.