Suppose I use relative positioning to exactly position a set of footprints exactly how I want them.
Now, later in the board design process I realize that I need to move this entire set of objects - not by drag/drop, but say by using the Arrange options (align center, align top, etc).
The problem is that if I move one object, the other objects that were positioned relative to it do not move with it. It looks like setting the position relative with Shift+P is a one-time operation that does not actually “link” the position in any way.
A simple example:
- I have a connector J1, a capacitor C1 and two resistors R1 and R2.
- I position C1 relative to J1, and then I position R1 relative to C1, and R2 relative to R1.
- Now, later in the board operation I realize that I need to line up J1 with J2 by doing “align top edges”. So I do so. But now, C1, R1 and R2 are in the wrong place.
- I now have to manually repeat all of the steps to move C1, R1 and R2 back into the correct positions based on relative positioning.
What I’ve considered/tried:
- Grouping. This doesn’t work because the group bounding box is not the same as J2’s bounding box. So J1 and J2 will not be lined up, but instead the entire group of J1, C1, R1 and R2 (and whatever bounding box that group ends up with) gets aligned with J2. If I “enter group” then it acts just as if the group doesn’t exist and independently moves J1.
- Some kind of script. I haven’t yet dove into how KiCad does scripting, but I’m not against learning how to write an automation script and I am an experienced programmer - I just don’t really know where to start with this kind of thing. (In a “Best case” scenario I would be able to include some sort of config file that specifies the part references and the relative position to some other part, and then press a key and have all the parts move according to the script. I could see all sorts of other “cool” ways to use the script to automate positioning as well - I basically need to be able to find a footprint by reference, determine the bounds of the footprint relative to its anchor point, and then be able to move the footprint.)
- Just group and use drag/drop. There’s just no way to do that precisely enough, especially if the goal is to exactly line up J1 and J2.
Does anyone have any advice that would help me optimize this workflow? Thanks!