1 Reply Latest reply on Aug 16, 2013 4:31 AM by vladimir.stoyanov

    Assign via on Net using vb script in Pads Layout

    venkateswaran.k
      Hi,
      I have requirement to assign a via on the nets which has without any via points. So i have written automation script using vb to assign via on net here the issue is not assigning any via on net.

       

      I appreciate your help on this.

       

      Code:
      .----------------------------------
      Sub Main()

       

      Dim PowerPcbapp As Object
      Dim docu As Object
      Set PowerPcbapp = GetObject(, "PowerPCB.Application")
      Set docu = PowerPcbapp.ActiveDocument

       

      Set PowerPcbapp = Nothing
      tpnts = GetviaPoints(docu, True)
      'MsgBox Pcbapp.ActiveDocument.Name

       

      End Sub
      -------------------------------------------------------
      Function GetviaPoints(doc As Object, Optional Sorted As Boolean = False)
      Set GetviaPoints = doc.GetObjects(0)
      Set nets = doc.nets
      If Sorted Then nets.Sort
      For Each aNet In nets
      Set vias = aNet.vias
      If vias.Count > 0 Then
      viaavail = True
      Else
      viaavail = False
      GetviaPoints.Add aNet
      End If
      Next

       

      End Function

       

      Regards,
      venkateswaran K