Bug: Setting hole annotation to inspection dimension changes units
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- record the annotations' style beforehand
- set to inspection dimension
- 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?
Showing the effect: