Friday, September 5, 2014

iLogic - Dimension Text Scale

You have some iLogic code to help you setup your drawing sheets and title block size (see this link from Jonathan Landeros for a great example of using iLogic to configure title block and borders). But when you change sheet to a larger size the dimension text is hard to read. You'd like to be able to adjust the dimension style text size as well.

Here is a quick iLogic rule that prompts the user to set the text size. You could remove the user input lines, and just have the value set depending on the sheet size as well.

'set active document as drawing document
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument

'get the active dim style
Dim oDStyle As DimensionStyle
oDStyle = oDoc.StylesManager.ActiveStandardStyle. _

'get current font size
Dim sFontSize as String
sFontSize = oDStyle.TextStyle.FontSize

'get user input
oInput = InputBox("Active Dimesnion Style = " &  oDStyle.Name _
& vblf & vblf &  "Enter a new font size in inches." , "iLogic", _
Round(sFontSize / 2.54,3))

'set font size for dim style
oDStyle.TextStyle.FontSize = oInput * 2.54

Here is a related topic also: