Parameter Tolerance - save and restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on a project to write some DLL classes, and part of it involves storing the contents of a parameter object so that it can be restored later. The Windows API has lots of nice features to convert types, including extensive methods for converting to and from Byte arrays, and I notice a Byte array is one of the ValueTypes for Attributes. So I set out to convert an entire Parameter object into a byte array, and back again. There were some properties I didn't bother with which I felt could be added later if needed, so I selected the properties I thought were essential. There were some challenges, but I think I did OK, until I got to the very last property on my list: Tolerance.
I've never delved into how the Tolerance object works in Inventor. I had other things to work on. So I don't even really know how it functions and what it does for a user. I've never felt the need for my purposes. But it seemed like it should be included in the stored Parameter object.
Storing it wasn't a big deal, even without knowing what the members are for. I stored an Enum, ToleranceType, as an integer, then two Strings (HoleTolerance and ShaftTolerance) and two Doubles (Lower and Upper). That seemed to be all there was.
The big problem seems to be that everything about the object is read-only, so I'm not quite sure how to restore the tolerance settings for a parameter. There are 9 methods, all beginning with "SetTo", and some of their names seem to correlate loosely with some of the names of the 14 ToleranceTypeEnum values, but it's anything but one to one.
Any insight into the Tolerance object is appreciated. Thanks!