venkateswaran
Newbie level 2
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
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