Script to repair labels with zero height

Document created by john_dube on Feb 11, 2009
Version 1Show Document
  • View in full screen mode

Due to a problem with default text size being set to 0, some labels were created with size / height of 0.


This script can be run from DxDesigner's command-line toolbar to open each schematic sheet in a project, find any zero-height labels, and set the height to 10 (0.10").

Option Explicit

Dim iFixedLabels : iFixedLabels = 0
Dim sSchematic, sSheet, objLabel
For Each sSchematic In Application.SchematicSheetDocuments.GetAvailableSchematics
     For Each sSheet In Application.SchematicSheetDocuments.GetAvailableSheets(sSchematic)
          Application.SchematicSheetDocuments.Open sSchematic, sSheet
          For Each objLabel In ActiveView.Query(VDM_LABEL, VD_ALL)
               If objLabel.Size = 0 Then
                    Application.AppendOutput "Fix Labels", "Zero height label, " & objLabel.TextString & " on schematic " & sSchematic & "." & sSheet & " will be set to 10"
                    objLabel.Size = 10
                    iFixedLabels = iFixedLabels + 1
               End If
Application.AppendOutput "Fix Labels", "Label repair script completed, updated " & iFixedLabels & " label(s)"


The script works with EE2007.x DxDesigner (tested with EE2007.3 Update 8).