Role of the Attributes?

Hi,

I want to start this post by asking what is the intended role of the attributes that appear in components and devices windows? Is this pure informative?

I have stumbled across the following situation. I have LEDs with different colors for which I want to assign the correct 3D model. The color is given by the manufacturing number and the attribute like in the follwing picture:

They appear in the schematic like this:

In the layout they look like this:

In the footprint library I have saved the 3D models like this:

Is there a way to connect this information together, like connect the 3D models that I defined with the COLOR attribute in the device window, or, much better with the MPNs? One solution that I found: right click in the layout and then choose the corresponding 3D model. But what if I have 100 LEDs? Do I need to do this manually for all of them? Is there a better solution, a more efficient solution? Like for example link this info in the library all together?

Baldly, I would like to propose here something. One can add further columns in the device manager where the part numbers are defined, like a drop list to select the correct 3D model already defined in the 3D models list. One can go further by adding a footprint column and a footprint variant column. With this, the MPNs are linked to the correct info, like correct footprint and correct color, correct package variant etc. When a MPN is placed in the schematic, everithing will be at its place. No manual work and not redundancy. I don’t know how difficult is to implement this in the program.

I think, by design, it is intended that for each variant like this I define a new device that has the MPN in the name and then map the correct footprint, correct symbol and the MPNs that have that symbol and that footprint and, where needed, define attributes. Am I correct? I think this way of organizing the library is an improvement to other libraray management systems like in Kicad, but I also think, it is not complete. It sometimes forces me to define new devices for only little added information or, like in the above case, I can’t solve it at all in the library, I think. Still, I like LibrePCB because it uses references for footprints and symbols and not copies. This is a big improvement.

Best,
Horia

Hi,

The main purposes of attributes are:

  • Composing the VALUE of a component of one or multiple different attributes, which are more convenient (and more structured) to specify than writing the VALUE manually (e.g. set VALUE of a capacitor to “{{CAPACITANCE}} / {{VOLTAGE}}” allows you to specify capacitance and voltage independently but the VALUE in the schematic is automatically shown as e.g. “100nF / 50V”.
  • Passing custom values from the schematic into symbols, which is mainly used for sheet frames which support attributes for page name, project name, author, date etc.
  • Distinguishing MPNs from each other (i.e. see what is the difference between them), though for this it would be good enough to just have a generic text field.
  • Support adding specific attributes to generated BOMs as columns.

Though in many cases attributes are actually not needed. In future they may get more functions (e.g. filtering parts in the “Add Component” dialog by attribute values or so).

That’s correct. Generally for your case, if you have 4 different LED colors, it means those are 4 different packages (general rule of thumb: if packages look different, you need to create separate packages for them in LibrePCB). Then, for each package you create one device. That device may still have several MPNs (e.g. one for tape&reel, one for bulk packaging, or one for higher temperature range or whatever). But all parts within the same device shall have the same LED color. This way you will automatically get the correct 3D model when you add any of those LEDs to the schematic.

I understand your idea to link parts to specific 3D models and I already had it too. But to be honest, there are many more such subtle cases where our library concept still does not reflect the reality perfectly fine. We would need to add tons of more complexity to fully reflect the reality. But this would also make LibrePCB more complicated so it breaks our vision of also being easily usable. So we always have to find the balance between good concepts and usability. At the moment I think linking to specific 3D models is not worth the added complexity as it can easily be worked around by creating separate devices.

Urban

I understand. My concern is that when I do create a package for each color I will for sure copy the first 3 times and I will just assign the correct 3D model. But if I discover later on that I made a mistake or want to add something I will have to change 4 packages. For example I see that the sign indicating the anode is in the wrong layer (in the above picture it does not appear in the layout like LEDx)

In this case can one implement something like “copy by reference” instead of “copy by value”? Or both with the option to chose? I do not know if this makes sense because if you have only the reference you can’t change the contents of it. You can change in this case only the contents of the original.

The copy&paste in the footprint editor works very well. You can just copy the updated polygon from one package to the others.