A key decision is to determine when to contact onshape and update the model of the part and when to just update the local model. I think we should be proactively updating the onshape model to always reflect the state of the part so as to avoid confusion. If that is the case than any change of the part requires a server call furthermore All State changes require a part recalculation in this context a part is more like a function than a class. It is possible that we could store part history in the class and have the class State represent the latest head on that history. That is beyond our scope.
Downloading custom measurements from a Part Studio
To do it efficiently, I need the following things for the Part class:
sync(): uploads new configurations from Part.configuration and downloads the latest variables that are changed to Part.output_dims. This needs to know what is left to be uploaded, and doesn't call sync unless there are variables to upload (this is a performance thing)
__need_to_sync (bool): a private variable that lets Part know if it needs to call the server.
-output_dims: a dictionary that contains all the dimensions. When something tries to access this and __need_to_sync is set to true, we need to call sync().
And within FeatureScript:
A function that allows one to select two parts and returns the distance. This is just a formal way to say "I want a measurement here." That function will be used to send back to Python whatever length you want. This gets more complex for assemblies - we won't support that for now. this is pretty much just the "measurement" function made into a feature.
A key decision is to determine when to contact onshape and update the model of the part and when to just update the local model. I think we should be proactively updating the onshape model to always reflect the state of the part so as to avoid confusion. If that is the case than any change of the part requires a server call furthermore All State changes require a part recalculation in this context a part is more like a function than a class. It is possible that we could store part history in the class and have the class State represent the latest head on that history. That is beyond our scope.