Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: WCrihfield

Hi.

 

Thanks very much for your response.  This did the trick!

 

My units are mm so I just changed the 499.4 to 49.94 and bingo!  I wasn't aware of the units issue so thanks for that.

 

This is how the code finished up:

 

Sub Main
	Dim oDoc As DrawingDocument = ThisDoc.Document
	Dim oSheet As Sheet = oDoc.ActiveSheet
	For Each oDim As DrawingDimension In oSheet.DrawingDimensions
		If oDim.ModelValue <= 49.94 Then
			If Round(oDim.ModelValue * 10, 1) -Round(oDim.ModelValue * 10, 0) = 0 Then  
				oDim.Precision = 0
			Else
				oDim.Precision = 1
			End If
		Else
			oDim.Precision = 0
		End If	
	Next
End Sub

 

Thanks very much for your help!

 

Cheers,

 

T