"Find Similar Objects"

I have been designing PCBs since 15 years ago, in Protel and Altium, but recently I have decided to switch to KiCad.
The feature of “Find Similar Objects” in Altium has been essential in a fast pace PCB manual routing; however, I realized this feature has not been implemented in KiCad yet – which was a shock. I was thinking maybe there are some alternative method for this feature in KiCad that I am unaware of.

1 Like

I haven’t used Altium or any other EDA besides KiCad, so could you explain what that feature does exactly and what’s the use case?

It’s an extension of the object properties model (that Orson is working on for KiCad)

So, if you can inspect all the properties of an object easily within code, you can build a search function to query all the objects as if KiCad were a database.

So you can answer questions like “give me all the tracks that are on layer F.Cu and of width 0.25mm”

Altium calls this “find similar objects” because their interface for this starts from the properties of one selected object. So you can see all of the properties of the object, and then search for (e.g.) all objects that have the same value for a certain property, or different values, etc.

So, if you have selected a track, “Find Similar Objects” will have the track width as one of the properties. You could then say “select all tracks that have the same width as this one” or different width, etc. You can do this across all the properties.

2 Likes

@Shoja tl;dr - The piece of back-end code that would enable something like ‘Find Similar Objects’ is only now being developed. “Patience, young grasshopper.” - Master Po (This is a reference to an American TV show from the 70’s.)

I wrote a Java program to do it then, I discovered it’s just as simple/fast to use the computer’s native Search feature.

Search can contain Wildcards and Boolean and can be entered or (on Mac) via search field input.

Thus, on my Mac, searching for a Capacitor with diameter of 5.1mm and pin Pitch of 12.50mm brings up (screenshot below)…

This kind of query is a specific use case of KiCommand. You can query items and filter them using any parameter desired. The command string you would use in KiCommand would be something like:

  • tracks F.Cu layernums onlayers copy GetWidth call 0.25 mm = filter select - select all tracks on F.Cu layer with width of 0.25mm.
1 Like

I was curious to see about using the computers search feature to look for @HiGreg example to querry.

I looked at the PCB in an editor (BBedit) and realized adding three Boolean parameters does the job…

Snippet of the PCB’s text… Thus, seeing “setup” paired the search down to eliminate other Kicad files…

Thus, Boolean searching for F.Cu AND 0.25 AND setup, produced the correct screenshot results below…

[EDIT] Added one more using a Part name (“Relay”) in the search instead of “setup”

Screen Shot 2020-06-25 at 9.49.04 AM

1 Like

This seems like a viable method: to use BBEdit and search. One thing to note is that with KiCommand, you can change the search parameters to a width range or “near” the desired width. The easiest would be to use roundn but even specific to/from range is possible, too. As always, use what works for you!

I’m sorry… I wasn’t clear: I used BBedit only to see what kind of stuff is contained in the file.

Having found words like “setup” and “relay” (for a couple of my PCB’s with relay’s) in the text, then I used the systems search feature. I did not use BBedit to search and there is no need for that, knowing I can search for files of any type containing the things I want to search…

And, I most often use another search app that easily does Boolean’s…

1 Like

I am using Protel 3 and I am switching to KiCad. In my opinion KiCad has some advantages regarding Protel 3 and some disadvantages. If I had Altium I would probably wait with switching to KiCad for at least V6 or may be V7.
In Protel 3 I am using “Options” button which I suppose is your “Find Similar Objects” to fast extend my action to other objects. I use it mainly to:

  • Hide/Show Designators (references) during documentation preparation
  • Hide/Show Comment (value) during documentation preparation
  • set the Designator Height, Width, Font, Hide of current footprint to all other footprints
  • set the Comment Height, Width, Font, Hide of current footprint to all other footprints

and rather rarely to change for example all 10 mils tracks to 8 mils or something like this. In my Protel to change track width I had to do it separately for strait tracks and for round tracks.

I found my way of solving these my documentation needs in KiCad. My first solution was to have Reference and Value at other layers (both with the same picture). It is because Export function allows for mixing several layers byt not allows for on/off References and Values.
My second solution is to not use Export but Plot (allows for on/off Ref and Value) and mix layers using Inkscape.

I don’t know what for the “Find Similar Objects” can be useful during routing.

Not sure if I am speaking exactly about the same feature. In Protel 3 (from 1997) when I enter (at PCB) the component edition I can Edit its (I listed only important for the feature I am writing about):

  • Attributes (Footprint, Layer, Rotation, Lock primitives, Lock, Selection),
  • Reference (Height, Width, Font, Layer, Hide, Mirror)
  • Value (Height, Width, Font, Layer, Hide, Mirror).

Then by pressing the “Options” button my edit window extends and for each of these three things I can specify “Attributes To Match By” (selection criteria) and “Copy Attributes” (check boxes to mark which attributes to copy from this element to all found by criteria).

For Reference and for Value to match you can use * and ? in text describing how to match.
For things like Footprint, Layer, Rotation, Lock Prims, Locked, Selection, Height, Width, Font, Hide you can select among Same/Different/Any.

I used it for example to Hide Footprint names for all P* components. My P* were the pads (or pad series) for wire soldering and its footprint names were long (external size, hole size, pitch) and not important for someone to see what elements are placed at PCB.

When you edit the track you can change its Width, Layer, Net, Locked, Selection. Then by using the same “Options” button you can select which of these attributes to use for search (for each you can select Same/Different/Any) and which attribute to copy (for each you have check box). Default is ‘Any’ and if you edited any attribute its checkbox is checked (when this Options - extended window opened) so Pressing “Options” and then at once “OK” buttons extends your changes to all tracks. So for example if you decided to move all tracks from Mid Layer 1 to Mid Layer 2 you:

  • double click any track at Mid1 - edit window opens,
  • change its layer to Mid2,
  • click “Options” button (in Copy attributes you have Layer checked),
  • in “Attribute To Match By” you change Layer from Any to Same,
  • you click “OK” button - done - all tracks from Mid1 are now at Mid2.

If you also for Net change Any to Same tracks of only that Net would be moved.

‘Find Similar Objects’ on Altium is an option, appearing whenever we right click any object and it helps us to apply the changes to some other similar objects.

For example: we want to change the size of pads of a chipset on the pcb layout. This feature allows us to change the size values of one pad and extend the changes only to other pads of that chipset, by finding similar object based on being the same component.

This can be very helpful in many cases. As another example, when we happen to need to change the hole size of a certain set of vias all together, and many similar cases.

This video gives a good introduction to what this feature is:

One very simpler way to implement such feature is the way old Protel versions used to do – by option called ‘global’. We could modify an object – like a via – and then use the option global to apply the change to other vias, based on limited number of options such as whether they are ‘selected’ or the same diameter or same hole size, etc.
The ‘Find Similar Objects’ is actually a very extended development of this feature.

While drinking Black Coffee, it dawned on me to try using Boolean in the search field of the parts selection panel. It works! Perhaps others knew that, I didn’t…

Example below (can use “:” or don’t use it, either way it works to filter and list as desired!)

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.