Replies: 2 comments 2 replies
-
The silkscreen of reference and the reference value are coupled in KiCAD. You cannot have one reference and show the other. What you could do is hide the reference and place a new text with the original reference. We don't support this in KiKit, however, you can implement it. However, I don't think it is a good idea. What is your use case? If it is building assembly data for a multi-design panel, I have plans for approaching this much cleanly: when building a panel, all information about a component are baked into the panel board (i.e., all information that are stored in schematic). Hence, the panel becomes a self-contained entity and we completely avoid a problem with pairing board and schematic components. |
Beta Was this translation helpful? Give feedback.
-
This is what I ended up doing in case anyone else faces the same problem: import pcbnew
def rename_references(board: pcbnew.BOARD, prefix: str):
for footprint in board.GetFootprints():
ref = footprint.Reference() # type: pcbnew.PCB_TEXT
if ref.IsVisible():
pcb_txt = pcbnew.PCB_TEXT(board)
pcb_txt.SetPosition(ref.GetPosition())
pcb_txt.SetLayer(ref.GetLayer())
pcb_txt.SetText(ref.GetText())
pcb_txt.SetAttributes(ref.GetAttributes())
# GetDrawRotation accounts for KeepUpright property of footprint texts
pcb_txt.SetTextAngle(ref.GetDrawRotation())
board.Add(pcb_txt)
ref.SetText(prefix + ref.GetText())
ref.SetVisible(False) |
Beta Was this translation helpful? Give feedback.
-
I'm using the Python API to panelize different designs. The reference designators have to be renamed because the same designator refers to different components on different boards. Setting the
refRenamer
argument works fine but it'd be better if there was a way to keep the silkscreen texts as-is.Beta Was this translation helpful? Give feedback.
All reactions