Updated!
Still having issues with AutoPlugins in nightly. Should still work from Scripting Console and “import kicommand”
Updates::
-
RENAMED todrawsegments to tosegments to better fit nomenclature (see below)
-
Added commands regex, bool, printf, zip, fprintf, pwd, cduser, cdproject, cd
-
Added a couple more tests in kicommand.test
-
modified init.py to update import, user’s should still use “import kicommand”
-
Updated callargs to allow non-lists as input.
Before: only a list of lists
Now: A list of lists, a single list, or a single value.
Before: [objectlist] [[arglist1],[arglist2]] where arglist1 applies to
object1, arglist2 applies to object2, then arglist1 and 2 are alternated
for each subsequent object.
Now: if you only have one argument, or one argument list, it is used as the
argument(s) for all objects.
SEGMENTS/POLY/POLYGON nomenclature:
“segments” as unconnected line segments (will extend later to nonlines such as arcs or curves) and “poly” as connected line segments.
-
“poly” is a single list of points where each point is a vertex of the joined lines.
-
“segments” are individual and independent x/y value pairs.
-
“polygon(s)” will refer to the upcoming polygon segments in v5/v6
Note that in either case, if a line is supposed to connect to the first point,
that first point (for poly) or segment (for segments) must be repeated at
the end of the list.
regex,bool,printf,zip,fprintf,pwd,cduser,cdproject,cd explain
Explaining regex,bool,printf,zip,fprintf,pwd,cduser,cdproject,cd
regex (Category: Comparison)
[LIST REGEX] Create a LIST of True/False values
corresponding to whether the values in LIST match the REGEX
(for use prior to FILTER)
bool (Category: Conversion)
[OBJECT] Return OBJECT as a boolean value or list. OBJECT
can be a string, a comma separated list of values, a list of
strings, or list of values.
printf (Category: Output)
[LISTOFLISTS FORMAT] Output each list within LISTOFLISTS
formatted according to FORMAT in Pythons {} string format
(https://www.python.org/dev/peps/pep-3101/).
zip (Category: Stack)
[LISTOFLISTS] Creates a list with parallel objects formed by
each list in LISTOFLISTS ((1,2,3)(4,5,6)(7,8,9)) ->
((1,4,7)(2,5,8)(3,6,9)).
fprintf (Category: Output)
[LISTOFLISTS FORMAT FILENAME] Output to FILENAME each list
within LISTOFLISTS formatted according to FORMAT in Pythons
{} string format
(https://www.python.org/dev/peps/pep-3101/).
pwd (Category: Programming)
Return the present working directory.
cduser (Category: Programming)
Change working directory to ~/kicad/kicommand.
cdproject (Category: Programming)
Return the project directory (location of .kicad_pcb file).
cd (Category: Programming)
[PATH] Change working directory to PATH.