Hi,
Does any of you know a reliable way to have a nice layout of several occurences of the same footprint ?
In my case I am making a 8x8 LED matrix display, so I have bunch of identical footprints that needs to be spread in a regular fashion.
In this example it goes from D1 to D64.
They are all in PCBnew, since the were in the netlist that was read. They are roughly spread with "Global Spread and Place".
Here's what I tried then:
- Select D1 with right-click
- Click Create Footprint Array
- Set paramateres as shown in screen capture
- ...
- Have a result with the footprint array, in which all have the same reference. (see second screen capture)
Am I doing something wrong ?
Is there another way ?
Is it yet another feature that is impossible in KiCAD ?
Thank you for your attention.
Edit: updated subject
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?
The problem is indeed that all the footprints are referenced as D1, while I would like them to be automatically numbered D1 to D64.
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.
Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).
My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?
The problem is indeed that all the footprints are referenced as D1, while I would like them to be automatically numbered D1 to D64.
in pcb delete all but D1 and try creating an array again
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).
That menu seems borrowed from pad-array inside footprints, and seems to not manage part renumber.
I'd say that feature 'needs work'...
Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
..
My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.
If you have them already imported, then best approach is probably to use a script to place them.
The Python code below uses a array of Ref/X/Y/R/S to place a group of parts in a specific way.
You probably do not need Rotate or Side info, but you get the idea....
import sys
from pcbnew import *
pcb = GetBoard()
RefNm = ['C1','C2','C3','C4','C5','C6','C7','C8','C9','C10','D1','D2',
'J1','Q1','R1','R2','R5','R6','R7','U1','U2','U3','U4','U5','U6','U7','X1','Y1']
RefX = [ 1150, 500, 1950, 700, 700, 1950, 400, 2100, 2100, 1150, 3535, 3465,
1575, 3100, 2050, 2050, 400, 3675, 3675, 1400, 1400, 2050, 2050, 750, 750, 650, 2600, 400]
RefY = [-1000,-1000,-1550,-1700,-1350,-900,-1550,-400,-1800,-1650,-1565,-565,
-375,-1200,-550,-1200,-1700,-925,-1275,-800,-1450,-800,-1450,-1600,-1250,-800,-600,-1400]
RefOri = [ 180, 180, 180, 180, 180, 180, 180, 0, 0, 180, 45, 315,
0, 90, 0, 0, 0, 255, 105, 0, 0, 0, 0, 0, 0, 0, 0, 90]
RefSide = [True,True,True,True,True,True,True,False,False,True,False,False,
True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False]
print('Start Place XYRS')
for Idx,Rn in enumerate(RefNm):
nPart = pcb.FindModuleByReference(Rn)
nPart.SetPosition(wxPoint(FromMils(RefX[Idx]), FromMils(RefY[Idx]))) # Update XY
nPart.SetOrientationDegrees (RefOri[Idx]) # Update Rot
if RefSide[Idx]!= nPart.IsFlipped(): # Current Side <> Reqd Side ? then flip
nPart.Flip (nPart.GetPosition())
print('Finished Place XYRS, Press F11 to refresh display')
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.
Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).
My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.
it seems they broke that feature, I tried in 4.0.2 and it worked as expected, in 4.0.4 they all get the same reference
YES, definitely a 4.0.3 & 4.0.4 issue. I reinstalled 4.0.2 and it worked.
Thanks everyone.
and now it is "won't fix"
so it was changed from something that could work to something that is guaranteed to not work...
Yes. I really didn't understand the explanation.
Alexander.
I understand the explanation, but I don't think the writer understands the problem. If this is the level of attention of the engineers working on KiCAD, then we're all in trouble.
I guess they
really don't want people to use this sofware.
I think commit 18f07d8efb66328a147c500a10644d2fa9050de7 did the change.
Alexander.