Sub ClickMoveDesPos
Dim Board
Dim Comp
Set Board = PCBServer.GetCurrentPCBBoard
If Board is Nothing Then Exit Sub
While Board.ChooseLocation(x,y, "Click Via To Change") = True
Set Comp = Board.GetObjectAtXYAskUserIfAmbiguous(x,y,MkSet(_
eComponentObject),AllLayers,eEditAction_Focus)
If Not(Comp is Nothing) Then
Call Board.ChooseLocation(x,y, "Select Location")
Call PCBServer.PreProcess
Call PCBServer.SendMessageToRobots(Comp.I_ObjectAddress,_
c_Broadcast, PCBM_BeginModify, c_NoEventData)
Comp.ChangeNameAutoposition = eAutoPos_Manual
Comp.Name.XLocation = x
Comp.Name.YLocation = y
Call PCBServer.SendMessageToRobots(Comp.I_ObjectAddress,_
c_Broadcast, PCBM_EndModify , c_NoEventData)
Call PCBServer.PostProcess
End If
Wend
ResetParameters
Call AddStringParameter("Action", "Redraw")
RunProcess("PCB:Zoom")
End Sub
www.tdpcb.com