X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Faltium%2Fpcb-resize-refdes-all.pas;fp=scripts%2Faltium%2Fpcb-resize-refdes-all.pas;h=6e40326414f5d6351a7613ba4e49baed8915d76b;hb=d2cace985fa8e2bbe86940fb7921d3b4afd829e1;hp=0000000000000000000000000000000000000000;hpb=0dc7006d16de56921ead4a834a444f9cfa0a09a4;p=eda-utils.git diff --git a/scripts/altium/pcb-resize-refdes-all.pas b/scripts/altium/pcb-resize-refdes-all.pas new file mode 100644 index 0000000..6e40326 --- /dev/null +++ b/scripts/altium/pcb-resize-refdes-all.pas @@ -0,0 +1,71 @@ +// Redimensionnement du texte des références de tous les composants + +Procedure PCB_ResizeRefDes_All; +Var + Board : IPCB_Board; + Comp : IPCB_Component; + Iterator : IPCB_BoardIterator; + +Begin + Pcbserver.PreProcess; + + Board := PCBServer.GetCurrentPCBBoard; + If Not Assigned(Board) Then + Begin + ShowMessage('The Current Document is not a Protel PCB Document.'); + Exit; + End; + + // Setup Board iterator + Iterator := Board.BoardIterator_Create; + Iterator.AddFilter_ObjectSet(MkSet(eComponentObject)); + Iterator.AddFilter_LayerSet(AllLayers); + Iterator.AddFilter_Method(eProcessAll); + + Comp := Iterator.FirstPCBObject; + While (Comp <> Nil) Do + Begin + // On ne modifie pas le numéro du PCB, qui est la référence du logo de compagnie + If CompareString(Comp.Pattern, 'LOGOCOMPANY', 7) Then + Begin + Comp := Iterator.NextPCBObject; + Continue; + End; + + If CompareString(UpperCase(Comp.Pattern), 'MIRE', 4) Then + Begin + Comp := Iterator.NextPCBObject; + Continue; + End; + + If CompareString(UpperCase(Comp.Pattern), 'CRACK', 5) Then + Begin + Comp := Iterator.NextPCBObject; + Continue; + End; + + // On ne modifie pas les fiducials + If CompareString(UpperCase(Comp.Pattern), 'FIDG', 4) Then + Begin + Comp := Iterator.NextPCBObject; + Continue; + End; + + // On ne modifie pas la légende des couches + If CompareString(UpperCase(Comp.Pattern), 'LAYERS', 6) Then + Begin + Comp := Iterator.NextPCBObject; + Continue; + End; + + // Call resize function + ResizeRefDes(Comp); + + Comp := Iterator.NextPCBObject; + End; + + Board.BoardIterator_Destroy(Iterator); + + Pcbserver.PostProcess; + Client.SendMessage('PCB:Zoom', 'Action=Redraw', 255, Client.CurrentView); +End;