edit Ordinate dimension

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everybody!
i am writing a macro that adds a tollerance and a few things to the selected ordinate dimension. the macro itself works, but not as i would like it to..
the problem is that whatever number of the ordinate dimension i select, it allways adds the tollerance to the very first value of the ordinate dimension, wich is the 0...
i would like it to do one of these two things (first one is better)
1) add the tollerance to the actual dimension the mouse is clicking on,
2) add the tollerance to the LAST (instead of first) dimension.
so basically at the moment if i have a ordinate dimension set with the values " 0 ------- 30 ---------------------100" the result is
" 0 +0,05 -------------30 -------------------------100"
i would like it to be
"0--------------------30-----------------------------100 +0,05"
it could be by clicking on the "100" value and executing the macro, or automatically by selecting the whole ordinate dimension...
thank you
best regards
alcom
[code]
Public Sub tolleranz()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oDrawingDims() As DrawingDimension
Dim a As Integer
a = 0
Dim i As Long
For i = 1 To oDrawDoc.SelectSet.Count
If Not oDrawDoc.SelectSet.Item(i) Is Nothing Then
If TypeOf oDrawDoc.SelectSet.Item(i) Is OrdinateDimension Then
a = a + 1
ReDim Preserve oDrawingDims(0 To a)
Set oDrawingDims(a) = oDrawDoc.SelectSet.Item(i)
End If
End If
Next
Dim n As Integer
For n = 1 To a
oDrawingDims(n).Tolerance.SetToSymmetric ("0,05")
oDrawingDims(n).IsInspectionDimension = True
oDrawingDims(n).SetInspectionDimensionData kRoundedEndsInspectionBorder, "", "100%"
Next
End Sub
[/code]