Part Height report

Discussion created by Snap_Boy on Jul 1, 2009
Latest reply on Oct 28, 2009 by kendall_hiles



Is there any Easy way to generate report of "Height of parts in Board"?


I am trying to generate MS-Excel report through following code


Sub Get_Height()


    Dim serverIsLocked As Boolean

    Dim prts As MGCPCB.Parts

    Dim prt As MGCPCB.Part


    Set prts = pcbdoc.Parts



   ' Define Header

    i = 2

    Range("A1").FormulaR1C1 = "part Number"

    Range("B1").FormulaR1C1 = "No. of parts"

    Range("C1").FormulaR1C1 = "Height"

    Range("D1").FormulaR1C1 = "Underside Height"



For Each prt In prts


    Range("A" & i).FormulaR1C1 = prt.Name

    Range("B" & i).FormulaR1C1 = prt.Components.Count

    Range("C" & i).FormulaR1C1 = prt.Height(epcbUnitCurrent)

    Range("D" & i).FormulaR1C1 = prt.UndersideHeight


    On Error Resume Next


    i = i + 1




MsgBox "Done!"

End Sub


But value of "prt.Height(epcbUnitCurrent)" is shows as "-1" for all components!!  


Any clue?