First time working with KiCad after previously making a few boards with eagle.
I saw there were a few other threads on how to layout footprints in a circle, however I really have no understanding of how scripting/python work.
I’m trying to follow this tutorial. But I’m a bit lost. My understanding is that I’m supposed to save the script in a specific place and then just type " import nameofscript.py" into the scripting console. I also don’t understand where I’m supposed to save the file. Can I create my own KiCad library folder and connect that directory to kicad?
I avoid implicit paths, and place my Python scripts anywhere, and then I include a comment in the .py file, of how to launch it, in the scripting console, like this
# eg Usage - in KiCad PcbNew Python Console paste after >>>
# >>> execfile("C:\KiCad_Python\Check_Footprint_Attr\PcbNew_Select_Track_Pad.py")
Looks like one issue, ie it cannot find that path.
The example I gave was for windows, so I’m not sure how mac manages the finer points of paths.
Does the mac have an equivalent to a Drive:\directory\tree\file.py ?
You need to remove the ‘~’. The tilde represents your home directory so by including it you are passing a path of ‘Users/timroony/…’ within your home directory. i.e ‘/Users/timrooney/Users/timrooney/Desktop/circle.py’ which obviously doesn’t exist.
Is your username ‘tim’ or ‘timrooney’ - you have used both in your question.
I haven’t tried running this but I would try typing;
import sys
print(sys.path)
This will show you where the kicad python is looking for modules. In order for you to run this, you probably need to import circle first but you need to place the script somewhere on the search path. The sys.path should give you a good idea of where to put it - probably something like /Applications/Kicad/kicad.app/Contents/SharedSupport/scripting/plugins
Move your script there and then try
import circle circle.place_circle(["c1", "c2"], 0, (500, 500), 1000)
Also check that you have imported your netlist. Are C1 & C2 light emitting capacitors ?
I originally tried this since it was included in the the tutorial, but the result doesn’t make much sense to me which lead me to my original confusion. Any idea why a sensible file directory isn’t appearing?
That sbyvfxtj29jdr_8k9x5zdh_00000gn business is MacOS security feature where it hides real paths from the application. In fact that maps to /Applications/Kicad/kicad.app in most cases so John_Pateman’s advice is solid.