Trying to understand the underlying database in Schematic to be able to both manage BOMs and do some work with Python to automate things.
I just ran into something peculiar that I don’t quite understand. I’m sure its something obvious, I just haven’t seen it yet.
After generating a BOM from a test schematic that consists of mostly stock parts from the stock libraries this caught my attention:
R1, R10, R11, R13, R15, R20, R21, R25, R26, 9 330 R_US_1
R12, 1 4.7K 1% R_US
R17, R18, R19, R22, R23, R24, 6 100 R_US_6
R2, 1 19.1K R_US
R3, 1 110K R_US
R4, R14, R16, 3 10K R_US_4
Note that there are multiple “R_US” variants. This is the “Cmp name” field in the BOM.
I took a look a the schematic file and found this:
(symbol (lib_id "Device:R_US") (at 60.96 72.39 270) (unit 1)
(in_bom yes) (on_board yes)
(uuid 00000000-0000-0000-0000-00005edae9f0)
(property "Reference" "R7" (id 0) (at 60.96 67.1322 90))
(property "Value" "" (id 1) (at 60.96 69.4436 90))
(property "Footprint" "" (id 2) (at 60.706 73.406 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 60.96 72.39 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid f9446bbe-b1cb-45cf-a29a-082cbc6f848c))
(pin "2" (uuid d7aacbcf-fb19-4266-ad3d-af83ce372548))
)
(symbol (lib_name "R_US_1") (lib_id "Device:R_US") (at 359.41 71.12 270) (unit 1)
(in_bom yes) (on_board yes)
(uuid 00000000-0000-0000-0000-00005ede0881)
(property "Reference" "R6" (id 0) (at 359.41 65.8622 90))
(property "Value" "" (id 1) (at 359.41 68.1736 90))
(property "Footprint" "" (id 2) (at 359.156 72.136 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 359.41 71.12 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 3367972f-528d-4624-89f4-0b3b2f6850f4))
(pin "2" (uuid acce2396-cc0f-49b8-9df3-4bee59c4dbf0))
)
(symbol (lib_name "R_US_2") (lib_id "Device:R_US") (at 359.41 78.74 270) (unit 1)
(in_bom yes) (on_board yes)
(uuid 00000000-0000-0000-0000-00005ede1624)
(property "Reference" "R8" (id 0) (at 359.41 73.4822 90))
(property "Value" "" (id 1) (at 359.41 75.7936 90))
(property "Footprint" "" (id 2) (at 359.156 79.756 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 359.41 78.74 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid d50b858f-870b-4b80-a32f-fd9892957fb1))
(pin "2" (uuid 1da08b61-e38a-47c0-a30b-9fc7d843ca7e))
)
The first block describes “R_US” for R7, then comes “R_US_1” for R6 followed by “R_US_2” for R8.
These all refer to “Device:R_US” as their source.
If I single-click on R8 on the schematic and look at the lower left status display, I see this:
So, R8’s “Name” is “R_US” but the name on the BOM is “R_US_2”. I cannot seem to find a reference to “R_US_2” anywhere on the schematic editor.
If I look at R8’s property sheet I get this:
How does “R_US_2” happen? Where does it come from? Is this created when you copy-and-paste symbols in schematic?
And here’s the kicker: This does not seem to happen with capacitors or any other components, just these resistors. I did not try any other type of resistor other than “R_US”.