Sub CloneViaNetOBJ
Dim Board
Dim ObjVia
Dim Borg
Set Board = PCBServer.GetCurrentPCBBoard
If Board is Nothing Then Exit Sub
Set ObjVia = Board.GetObjectAtCursor(MkSet(eViaObject)_
,AllLayers,"Select Via to Clone")
NetIterator = Board.BoardIterator_Create
NetIterator.AddFilter_ObjectSet(MkSet(eNetObject))
NetIterator.AddFilter_LayerSet(AllLayers)
NetIterator.AddFilter_Method(eProcessAll)
Set NetFound = NetIterator.FirstPCBObject
While FoundIt = 0 AND Not (NetFound Is Nothing)
If NetFound.Name = ObjVia.Net.Name Then
FoundIt = 1
else
Set NetFound = NetIterator.NextPCBObject
End If
Wend
Call PCBServer.PreProcess
While Board.ChooseLocation(x,y, "Click Via To Change") = True
Set Borg = Board.GetObjectAtXYAskUserIfAmbiguous(x,y,MkSet(_
eViaObject),AllLayers,eEditAction_Focus)
If Not(Borg is Nothing) Then
Call PCBServer.SendMessageToRobots(Borg.I_ObjectAddress,_
c_Broadcast, PCBM_BeginModify, c_NoEventData)
'Need to add the via to the net group, not the other way around!
NetFound.AddPCBObject(borg)
Call PCBServer.SendMessageToRobots(Borg.I_ObjectAddress,_
c_Broadcast, PCBM_EndModify , c_NoEventData)
End If
Wend
Call Board.CleanNet(NetFound) 'How to clean all nets?
Call PCBServer.PostProcess
ResetParameters
Board.BoardIterator_Destroy(NetIterator)
Call AddStringParameter("Action", "Redraw")
RunProcess("PCB:Zoom")
End Sub
Click the via with the net that you want
Then click the ones you want to change.