Need help using replicate_layout plugin

New user (coming from Eagle), first post. So far I really like KiCad and I’m trying out some of the more advanced functionality before deciding to punt on Eagle (besides, I need to do a 12" long board).

I want to replicate a layout N times. It looks like the replicate_layout plugin is exactly what I need!

I’ve installed the plugin, it shows up under Tools-plugins. I’ve read the readme, but I can’t seem to figure out how to use it. If a tutorial exists somewhere, I’ll be happy to read it before asking more questions.

I have hierarchical schematic sheets. The “sub” sheets contain copies of what I want replicated in layout. I’m starting with 4 sheets that all reference the same schematic file.

But, when I update the pcb from the netlist in Pcbnew, I see no difference versus what I saw when everything was “flat” on the top sheet. I see ALL the parts, a copy for each sheet.

So, I can’t figure out how to choose something to replicate. Do I have to first do a layout for the replicated schematic sheet and associate with a footprint (or something similar)?

I tried having just one instance of the sheet to replicate, rather than N (N will be 4 to start out with). I’m calling it Emitter 0–it references emitter_driver.sch.

I create a netlist, then open pcbNew, then import the netlist.

I select one footprint of a device on the sub sheet, then activate the replicate_layout plugin.

Under hierarchy level, emitter_driver.sch shows up. Nothing shows up in the “sheets to replicate” area. And EEscehma has descended into the emitter_driver.sch.

I must be doing something subtlety different, since when I tried before, sometimes I saw the top level sheet in the hierarchy level. That’s what I think I want.

Any hints would really be appreciated?

O

Author here. I’ll admit that the plugin documentation is almost non-existent.

The plugin replicates an existing layout. There were some approaches to place the components on pcb according to how they are placed in schematics, but I can’t point you to them from the top of my head.

For start you’ll need to place and layout all the footprints from one of the four sheets. Once you are happy with it choose a footprint in the layout out sheet. Place corresponding footprints from the “destination” sheets where you want their final position. For ordered placement place footprints plugin might help. Then select the chosen footprint in layed out sheet and run the plugin. Select the hierarchical level you wish to replicate (this comes into play with deeper hierarchies) and pages you want to replicate. Chose other options and let the plugin finish.

I do hope this is more understandable

1 Like

Thanks for the quick reply!

Right now, I’m just “kicking the tires”. So, I I haven’t done any traces, but I expected the footprints to get replicated. If that worked, I was going to take the time to do a really good layout (including traces) that I can replicate.

So, I just want to replicate the component placements in the sub sheet 3 times (total of four instances) and have everything still linked to a schematic that has 4 subsheets. One for each instance.

Should that work? If so, I can’t figure out what I’m doing wrong.

And, to clarify, should I have four sub sheets on the root schematic to start with, or just one?

I think I’m doing what you said, but the top level sheet isn’t showing up in the replicate_layout menu–just the subsheet.

You must have several subheets, but so that there’s only one file to which all those sheets point to. And they must be “siblings”, the boxes should be located in the same sheet - I don’t know if it can work otherwise.

The point is that the symbols are replicated in the hierarchical sheets and the layout can be done once for one sheet and then replicated to each sibling sheet’s content.

Just to make it sure you have understood correctly - the plugin doesn’t replicate the footprints. The footprints are already there because there are several identical hierarchical sheets (pointing to the same file) in the schematic. The plugin just replicates the locations of the footprints.

3 Likes

Ok, got a bit farther.

I went back to having four sub-sheets.

I guess I only needed to click on the subsheet schematic name that shows up in the “Hierarchy Level” area. When I do that, I see the names of three of the four subshees in the “sheets to replicate:” area.

So, I’m thinking that the one you choose is the “target layout”? The footprint selected before the plugin is run defines the “source layout”?

That makes sense and I did see another set of instances get created in the pcbNew and one set went away. Probably the target instances got deleted and replaced with a displaced copy of the source layout.

I’ll go with that assumption and play some more. Haven’t quite figured out anchor point and how to define dx, dy for the replicate (I just need dx, dy will be zero in my case).

Please let me know if I’m misunderstanding something.

Thanks!

In a post in the “replicate layout” thread (Replicate layout: Action plugin) I gave instructions which helped at least one user, and it was quite thorough instructions for using the plugin. See if it can help you, too.

3 Likes

It works great!

The reasons I got stuck:

  1. Expected the root sheet to show up under “Hierarchy level” in addition to the sibling schematic.
  2. Didn’t know I should select the sibling sheet schematic under Hierarchy level. That would be obvious if there had been multiple schematic files referenced in sibling sheets, but there was only one in my case. What a silly thing to have cost me so much time!

Thanks again!

Yup.

They got moved.

This is defined by the position of the anchor footprint in target sheets. E.g. if you have on a sheet an opamp and a couple of passives. When you select an opamp before rinning the plugin the layoit will be replicated to the postition(s) wher opamp from the target is(are)

1 Like

Wow, this is really awesome!

I really didn’t grasp how helpful it was. It’s really nice to be able to place a reference footprint in each layout instance, then with a single click get all components placed exactly the same (relative the reference footprint) as the source layout.

Thanks for the cool feature. And even more importantly, the great support!

While I have your appreciation, if you feel like it you can volunteer and improve documentation :slight_smile: .

1 Like

The easiest way to write some documentation is to start with personal notes of the things you discovered. Then add some general stuff, such as where to get your plugin and installing etc. Then write a few lines as introduction to what the thing is used for and post it as a general thread here. If it gets enough attention it may be turned into an FAQ article.

Sure, I’ll be happy to do that!

I might have been using a fairly narrow scope, but I’d be happy to write something up.

Personally, I like a video tutorial. If you write all the detail (all the clicks, etc), it makes something look a lot harder than it really is. But, with the video, you can put it on 2x and slow down through the parts that seemed tricky (like seeing a click on the .sch in the hierachy view).

Normally I post to YouTube. Should I just post a link as a general thread?

The only documentation I’ve done is the one within the README.md o Github. As I know that usage of such a plugin is highly visual, I’ve considered making a video, But I chose animated gif as it is much lighter bandwidth wise. And I’ve quickly figured out that making visual documentation is real PITA. While making screenshots if you move the viewport, or change zoom level things become confusing really fast. So if you find at the end on screenshot sequence, that you need to change something, you need to redo the whole sequence. And sometimes you find out this only after you annotated most of the sequence. It becomes really tedious really fast. And then you update the plugin and you need to redo the documentation. So I’ve lost the motivation.

If you do make a video, please post a link

1 Like

I use an application for making demos, so it makes it a lot easier. I find it essential for showing my customers how to use applications I develop.

You can use screen shots, but I typically record the entire session, then edit it down later. You don’t have to redo the entire video, it’s just like editing any video. But it IS time consuming.

I will do a video, probably before the end of the week.

Thanks again,

1 Like

Different peoples work in different ways.
I do not like youtube videos for getting infromation. I have no patience to sit through them without even knowing whether what I want to know is even disclosed in the video.

With text you can search for keywords, or skim through the chapter index for an idea what’s it about.

Sometimes the description of youtube videos has an index with time staps such as:
00:00 introduction
02:12 Installing
03:46 etc…

2 Likes

If you do, I’d appreciate it if you look at the project which comes with the plugin. If it can serve as it would be great.

And regarding the naming, I have on my to do list to change the nomenclature so that I will use “source” and “destination” terms. The terms used will therefore be: source layout, source anchor footprint, destination anchor footprint, source sheet, destination sheet, … If you could keep that in mind when referencing and/or making annotations. I also just pushed the changes so that GUI uses the same terms.

BTW did the animated gif pass any valuable information to you when you started with the plugin?

If you do, I’d appreciate it if you look at the project which comes with the plugin.
Can you help me find it? The pcb file in the gif file seems to replicate_layout/referfence multiple_hierarchy/multiple_hierarch… Is that what I should use?

BTW did the animated gif pass any valuable information to you when you started with the plugin?

I must have watched that gif 100 times over the course of a couple of hours.

First, it was too fast I couldn’t figure out how to slow it down. Then, I fixated on not seeing my top level sheet–I should have realized the only reason the hierarchy showed up in your example was that there were 2 levels of hierarchy.

Personally, I think it would be better to keep the example as simple as possible. Using for deeper levels of hierarchy is nice, but that complicates things. I’d have it as a second example.