Parameter Tolerance - save and restore

Parameter Tolerance - save and restore

DonStauffer99
Advocate Advocate
150 Views
1 Reply
Message 1 of 2

Parameter Tolerance - save and restore

DonStauffer99
Advocate
Advocate

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!

0 Likes
151 Views
1 Reply
Reply (1)
Message 2 of 2

DonStauffer99
Advocate
Advocate

Is there someone who is familiar with the API Tolerance object who can advise me on how to set that information via the API?

 

Trying to convert a parameter to an array of Byte, so that if I delete it after that, I can restore it from that array. Converting data to Bytes I can do with no big problem. But it's the Inventor API calls to cull the needed data, and then the calls to "put it back" after parameter deletion that I'm struggling with. I've been guessing, but when it comes to the Tolerance object its members are read only and I don't know of any classes or members which let me set those values.

0 Likes