Bug: Setting hole annotation to inspection dimension changes units

Bug: Setting hole annotation to inspection dimension changes units

Ethibaudeau
Advocate Advocate
408 Views
3 Replies
Message 1 of 4

Bug: Setting hole annotation to inspection dimension changes units

Ethibaudeau
Advocate
Advocate

I have a script that loops through all the dimensions, hole & thread annotations, and feature control frames on a drawing sheet to turn on the inspection dimension bubble.

 

Particularly for hole & thread annotations that have a smooth hole (i.e., no threads) and a metric 'mm' style dimension, the below code switches some sort of units and gets multiplied by 10x. Seems like it could be related to Inventor's internal use of 'cm'?

 

For Each oThreadNote In oThreadNotes
    oThreadNote.IsInspectionDimension = True
    oThreadNote.SetInspectionDimensionData _
      (InspectionDimensionShapeEnum.kRoundedEndsInspectionBorder, i)
    i = i + 1
Next

 

 

 

where "i" is simply an integer count incremented with each iteration.

The workaround we discovered is to

  1. record the annotations' style beforehand
  2. set to inspection dimension
  3. apply the previously recorded style.

In this way the script works with both 'mm[in]' and 'in[mm]' templates we use.

 

 

 

For Each oThreadNote In oThreadNotes
    oThreadNoteStyle = oThreadNote.Style
    oThreadNote.IsInspectionDimension = True
    oThreadNote.SetInspectionDimensionData _
      (InspectionDimensionShapeEnum.kRoundedEndsInspectionBorder, i)
    oThreadNote.Style = oThreadNoteStyle	
    i = i + 1
Next

 

 

 

 

I believe user @SER4 had the same issue here:
"Hole and Thread" dimensions as "Inspection Dimension". How do you do it? 

 

@bbgustaf @bbrownellLS4J4 

 

Showing the effect:

inventor.PNG

409 Views
3 Replies
Replies (3)
Message 2 of 4

Ethibaudeau
Advocate
Advocate

Additionally, this action of setting the annotation to "inspection" also resets any changes of the tolerance type (e.g., symmetric, deviation, etc.) back to the default style. The ugly thing is the same workaround as above does not work since I can record the tolerance style before turning inspection on, but I can not write to the tolerance property as it is read only.

0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor

Hi @Ethibaudeau.  The Tolerance property may be ReadOnly, but that just means you can't have another Tolerance object and set that as the Value of that Property.  It does not mean that you can not change the Tolerance object you get from that Property by using its Methods.  Just a heads up.  There are several situations like that in the Inventor API.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

Ethibaudeau
Advocate
Advocate

Ah, thanks for the clarification, that makes sense. Though, I still don't want to create a ton of logic to record all those properties, then figure out which of the 9 methods to pick and enter that data back in.

 

Really, this bug just needs to be fixed. Turning on inspection numbering shouldn't change the annotation at all.

0 Likes