AnsweredAssumed Answered

How to place a through pin with Automation

Question asked by barbier_g on Sep 3, 2019



I would like to get padstack name of the through pin with the smallest drill size hole from a first PCB and place on a second PCB (coupon test) this type of through pin.


Script :

 Dim pstkObColl, pstkObObj, pstkObObjName(), pstkObObjFinal, holesColl, holeObj, holeObjDrillSize(), holesCollFinal, holeObjFinal, i, j
 Set pstkObColl = pcbDocObj.PadstackObjects(epcbPadstackObjectPin)
 i = 0
 Redim pstkObObjName(i+1)
 Redim holeObj(i+1)
 For Each pstkObObj In pstkObColl
  pstkObObjName(i) = pstkObObj.Name
  Set holesColl = pstkObObj.Holes
  For each holeObj In holesColl
   holeObjDrillSize(i) = holeObj.DrillSize
  i = i + 1
  Redim Preserve pstkObObjName(i)
  Redim Preserve holeObjDrillSize(i)
 holeObjFinal = holeObjDrillSize(0)
 pstkObObjFinal = pstkObObjName(0)
 For i = 0 to UBound(pstkObObjName)-1
  msgbox holeObjDrillSize(i)
  j = 0
  While j <> UBound(pstkObObjName)
   If holeObjDrillSize(i) > holeObjDrillSize(j) Then
    pstkObObjFinal = pstkObObjName(j)
    holeObjFinal = holeObjDrillSize(j)
   End If
   j = j + 1


Thank you for your support,


Best Regards