How to read MDB toleance-values with VBA-AddIn

How to read MDB toleance-values with VBA-AddIn

hanno.stertz
Explorer Explorer
567 Views
2 Replies
Message 1 of 3

How to read MDB toleance-values with VBA-AddIn

hanno.stertz
Explorer
Explorer

Hey there, 

i'am trying to extract the tolerance feature for further use. My goal is to programm an interface use the type of the tolerance (flatness,..) and the corresponding value in another tool to do a 3D tolerance analysis with polytopes. 

Therefore i tried to find the values, but i got stuck at the ModelToleranceFeatureDefinition. I could extract the name of this feature and the datum feature, but not the value or the type. Is there a way to achive something like that? 
I know, that the values and types should be described in the AP242 STEP-File, that i need anyway, but i want to get around extracting the values from this file, since the values should be easily accessible in the software, that created them, i think. 

 

Thanks in advance! 

 

Best Regards, 

Hanno  

0 Likes
Accepted solutions (1)
568 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

Is this what you are looking for?

(Value is in [cm] displayed in [mm])

 

2023-05-31_14-24-21.png

0 Likes
Message 3 of 3

hanno.stertz
Explorer
Explorer

Yes, this is what i was looking for. 
I tried to find the ModelFeatureControlFrame befor, but wasn successfull and i'am still not. 
I found two trees:

1.

ThisApplication->ActiveDocument->ComponentDefinition->ModelToleranceFeatures->Item1
----> This gives me a ModelToleranceFeature, where i can see the name of the Feature and its DatumFeature

 

2.

ThisApplication->ActiveDocument->ComponentDefinition->ModelAnnotations->ModelFeatureControlFrames
-----> Here the count is 0, but i assume, that the ModelFeatureControlFrame, you had selected should be in here? 

 

I'am sorry, but i'am not able to find the tolerance feature you showed, even though it should exist. It would be nice, if you could tell me, where to find it. 

Thanks in advance! 

0 Likes