kicommand_persist.commands 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. :persist wxpoint "Geometry [X,Y] Create a wxpoint" pcbnew list swap list wxPoint callargs ;
  2. :persist toptextobj "Elements Get the top level text objects." drawings EDA_TEXT filtertype ;
  3. :persist valuetextobj "Elements Get all module's Value text objects." modules Value call ;
  4. :persist referencetextobj "Elements Get all module's Reference text objects." modules Reference call ;
  5. :persist moduletextobj "Elements Get all module's text objects that are not Value and not Reference." modules GraphicalItems calllist EDA_TEXT filtertype ;
  6. :persist drawparams "Draw [THICKNESS,WIDTH,HEIGHT LAYER] Set drawing parameters for future draw commands.\nExample: 1,5,5 mm F.Fab drawparams" 'l param t,w,h param ;
  7. :persist textfromobj "Elements [TEXTOBJECT] Get the text string from a text object." GetShownText call ;
  8. :persist valuetext "Elements Get all module's Value text as a string." modules GetValue call ;
  9. :persist referencetext "Elements Get all module's Reference text as a string." modules GetReference call ;
  10. :persist not "Programming [VALUELIST] Invert the boolean value. False, 0, None becomes True and True, non-zero, non-empty list becomes False." ' = ;
  11. :persist copy "Programming Copies the top of the stack." 0 pick ;
  12. :persist setselect "Elements [OBJECTLIST] Sets the objects as Selected." SetSelected call pop ;
  13. :persist clearselect "Elements [OBJECTLIST] Sets the objects as Unselected." ClearSelected call pop ;
  14. :persist orthogonal "Draw Make the angle between all elements a integer multiple 90 degrees." 90 makeangle ;
  15. :persist clearallselected "Elements Clear the selection of all items."
  16. modules copy GetReference call clearselect
  17. copy GetValue call clearselect
  18. copy GraphicalItems calllist clearselect
  19. clearselect
  20. pads clearselect
  21. tracks clearselect
  22. drawings clearselect
  23. ;
  24. :persist outlinepads "Draw Outline all pads using line segments with the layer and width specified by drawparams."
  25. pads copy corners swap copy GetCenter call swap
  26. GetOrientationDegrees call rotatepoints drawpoly
  27. ;
  28. :persist outlinetext "Draw Outline all text objects with the layer and width specified by drawparams."
  29. valuetextobj
  30. referencetextobj append
  31. moduletextobj append
  32. toptextobj append
  33. copy GetTextBox call corners swap copy GetCenter call swap
  34. copy GetTextAngleDegrees call swap GetParent call Cast call GetOrientationDegrees call
  35. +l rotatepoints drawpoly
  36. ;
  37. :persist outlinetoptext "Draw Outline all top text objects with the layer and width specified by drawparams."
  38. toptextobj
  39. copy GetTextBox call corners swap copy GetCenter call swap
  40. GetTextAngleDegrees call rotatepoints drawpoly ;
  41. ;
  42. :persist texttosegments "Draw [TEXTOBJLIST LAYER] Copies text objects in TEXTOBJLIST to LAYER."
  43. swap copy GetThickness call list swap
  44. topoints pairwise 2 pick tosegments
  45. copy 2 pick SetWidth callargs pop
  46. swap pop swap pop
  47. ;
  48. :persist regularsize "Draw,Geometry [SIDELENGTH] [PARALLELANGLE] regularsize takes the selected segments, joins them into a regular polygon, then sizes the edges to the specified length, and places one of the edges parallel to the specified angle Example: 30 mm 0 regularsize"
  49. drawings selected copy connect copy
  50. regular copy copy length delist stack 4 pick swap /f
  51. scale copy delist list angle delist 2 pick swap -f rotate
  52. pop pop
  53. ;
  54. :persist range "Programming [START,STOP,INC] Returns a list of numbers" builtins 'range sindex list stack swap int list fcallargs delist ;
  55. :persist len "Conversion [LIST] return the length of the list" ilist list list builtins 'len sindex list swap stack fcallargs sum stack ;
  56. :persist newboard "Elements Create a new empty board and make it the current board." pcbnew list BOARD call delist Board spush ;
  57. :persist newadd "Elements [TYPE PARENT] Add a new element of TYPE to PARENT. Returns the new module." list copy pcbnew list swap list 3 pick callargs 1 pick 1 pick list Add callargs pop swap pop swap pop delist ;
  58. :persist drawsegments "Draw [POINTSLIST] Alias for drawpoly." drawpoly ;
  59. :persist true "Programming Returns the value True." 1 bool ;
  60. :persist false "Programming Returns the value False."' bool ;
  61. :persist regexref "Filter,Comparison [MODULELIST REGULAREXPRESSION] return only those modules in MODULELIST whose reference are matched by the REGULAREXPRESSION" swap copy GetReference call 2 pick regex isnotnone filter swap pop ;
  62. :persist refobj "Elements [MODULELIST] Return the reference objects of the modules" Reference call ;
  63. :persist setvisible "Elements [OBJECTLIST] Set the objects to visible." true SetVisible callargs pop ;
  64. :persist clearvisible "Elements [OBJECTLIST] Set the objects to invisible." false SetVisible callargs pop ;