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

iLogic To Round Dimension On Drawing

Alexrose1942
Advocate

iLogic To Round Dimension On Drawing

Alexrose1942
Advocate
Advocate

I need a dimension style that rounds up to next 5mm , in Autocad its part of the settings you can change but in inventor it still doesn't exist.

i thought maybe there's a way with iLogic Or through the 'API Object Model' that this can be done?

 

Thanks 

Reply
Accepted solutions (1)
740 Views
2 Replies
Replies (2)

Anonymous
Not applicable
Accepted solution

Hi Alex,

 

Hope my code will be helpful for you

 

Dim oDrawDoc as DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oDrawingDimension as object
For each oDrawingDimension in oDrawDoc.Activesheet.DrawingDimensions.GeneralDimensions
Dim oDimValue as Double
oDimValue = oDrawingDimension.ModelValue * 10
oDimValue = (Round(oDimValue/5))*5
oDrawingDimension.OverrideModelValue = oDimValue / 10
Next

Note: This will round of only the drawing driven dimension if you delete the dimension and repeat the dimension it will load the default dimension value again you need to run the rule. 

 

Alexrose1942
Advocate
Advocate

@Anonymous wow that's a great code! ill give it few tests and see what improvements i can suggest.