Message 1 of 2
iLogic code to change selected dimensions to fractional
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I patched together an iLogic script to change selected dimensions on a drawing to fractional. It works sometimes, but occasionally it changes all of the drawing dimensions rather than the selected. I don't have a decent understanding on how styles work so if someone could point out the flaw in my script that would be great.
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument ' Determine if there are any dimensions in the select set. Dim oSelectSet As SelectSet oSelectSet = oDrawDoc.SelectSet Dim colDimensions As New Collection Dim i As Long For i = 1 To oSelectSet.Count If TypeOf oSelectSet.Item(i) Is DrawingDimension Then ' Add any dimensions to the collection. We need to save them ' in something besides the selection set because once we start ' manipulating them the select set will be cleared. colDimensions.Add(oSelectSet.Item(i)) End If Next If colDimensions.Count < 1 Then MsgBox ("You must select at least 1 dimension for this operation.") Exit Sub End If Dim oDimension As DrawingDimension Dim oDimStyle As DimensionStyle For i = 1 To colDimensions.Count oDimension = colDimensions.Item(i) oDimStyle = oDimension.Style oDimStyle.LinearUnits = 11272 oDimStyle.DisplayFormat = 78337 oDimStyle.LinearPrecision = 41744 Next
Thanks,
Harvey