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

iLogic To Round Dimension On Drawing

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 

Anonymous
in reply to: Alexrose1942

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
in reply to: Anonymous

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