Creating parts with variants


I’m creating some generic parts and i was wondering if it’s possible to make a custom part with variants using the part editor. (i.e : like the generic LED part, or Resistor, for which it’s possible to change values and displayed image within the circuit editor).

For example, i want to create the LM741 operational amplifier (datasheet) and i would be able to have the full schematic representation (like any other IC) or to switch to the usual OPA representation (with a triangle). I guess i should use the “variant” field, but i can make it work :sob:

If it’s not possible, it would be a nice feature :wink:

Thanks for any help,

The answer is yes and no. :wink: We make a difference between “normal” variants and “programmatic” variants:

  • “Normal” variants are just similar parts that share the same “family”, but differ in some regard. For example, there is an Arduino Mega and and an Arduino Uno, both in the “Arduino” family, but with a different property “type”.
    So by simply giving two parts the same “family”, and a different value for some other property, fritzing will create the drop-down interface for it. This can be done in the parts editor.

  • “Programmatic” variants try to be smarter: Instead of creating a zillion individual resistor drawings with different colored rings, there is only one resistor part that is specially programmed to change its look based on the different property selections. This has to be done in C++ code.

In your case, you could very well use the “normal” approach. Just be sure to give both the same family, and name the differentiating property appropriately, for example “symbol”.

1 Like

Thanks !

In fact, that’s what i used, but i think Fritzing need to be rebooted (or at least to reload the personal collection of components), because yesterday, i just could’nt switch between these two “composants” and now i can :smile:

Anyway, i guess yes but, is it normal if I got two components in “MINE” library like in th picture bellow ? (These two are just the two variants of my component.)

And, to conclude, is the “family” is the only property which define a part ?
For example : i’ve made the 7404 chip (hex inverter) and set the “family” property to “74xx”, because it’s a part of the 7400 series chips. If I make the 7400 one (quad nand) and I set family to “74xx” will Fritzing use the 7400 as a variant of the 7404, or the different part name will prevent that ?

Thanks a lot for your perfect reply ! :smile:

The two chips :

Great! And yes, you need to restart fritzing to see the changes.

The same “family” means that parts will be grouped and therefore become interchangeable; with the properties you then say how they differ within the family.
So in your example, family “74xx” is a good choice. Then you add a property with a name “type” or “function” etc., and give it different values depending on the chip, so for example “quad nand” or “hex inverter”. You can also add another property “part number” that gets “7404” etc.
Fritzing will then generate drop-downs for these properties, which you can use to switch between them.
The part name has no relevance.

The fact that you have the two chips showing in your “mine” bin is totally fine, since they are actually two separate part descriptions. You could even remove one of them, and you would still be able to access it through the other one (by means of the variant drop-down).
A bin is only always a selective view on the total set of parts. That is, you can create a bin that only has one part in it (like let’s say the Arduino UNO), but it will still let you access all other Arduino variants through it.