Find Dimension Overrides using iLogic

Find Dimension Overrides using iLogic

Veerappa
Contributor Contributor
904 Views
1 Reply
Message 1 of 2

Find Dimension Overrides using iLogic

Veerappa
Contributor
Contributor

Hi All,

 

I got this ilogic rule in forum. Is it possible to change override dimension text height? Because it is very difficult to read in large drawings.

 

'-------------Start of ilogic ------------------------------------------------

' Set a reference to the active document.

Dim oDoc As DrawingDocument

oDoc = ThisApplication.ActiveDocument

 

'Define the drawing dims collection

Dim oDrawingDims As DrawingDimension

 

'Dim oColor As Inventor.Color

Dim oColor As Color


'Prompt user to choose highlight / un-highlight

Dim booleanParam as Object

booleanParam = InputRadioBox("Select an Option", _

"Hightlight Overrides", "Un-Hightlight Overrides", True, Title := "iLogic")

 

'Loop through all dimensions and set colors

For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions

   If booleanParam = True then

   'set color to magenta

   oColor = ThisApplication.TransientObjects.CreateColor(255, 0, 255)

   else

   'set color to black

   oColor = ThisApplication.TransientObjects.CreateColor(0, 0, 0)

   oColor.ColorSourceType = ColorSourceTypeEnum.kLayerColorSource

   end if

  

   if oDrawingDims.HideValue = True _

   or oDrawingDims.ModelValueOverridden = True then

   oDrawingDims.Text.Color = oColor

   Else

   End if

Next

'-------------End of ilogic ------------------------------------------------

 

Thanks,

KT. Veerappa

 

 

 

0 Likes
905 Views
1 Reply
Reply (1)
Message 2 of 2

MechMachineMan
Advisor
Advisor

Something like the below code might work...

 

But why not just create a different text style with a larger/smaller text size, use the shift+right click menu to select all dims, then swap the style back and forth as necessary?

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument

Dim oDrawingDims As DrawingDimension

newsize = InputBox("Enter new text height in cms", "Ha", ".125")

For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions
       oDrawingDims.Text.FormattedText = "<StyleOverride FontSize='" & Newsize & "'><DimensionValue/></StyleOverride>"
Next 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type