gauravmm / HierarchicalPcb

MIT License
32 stars 6 forks source link

Support KiCAD 8.0 #7

Closed gauravmm closed 6 months ago

gauravmm commented 8 months ago

Here's what needs to be done to support KiCAD 8:

gauravmm commented 8 months ago

I can't figure out how to add a net to the API, or even if I need to bother at all. I'll run some experiments and then decide, but if you know something about this let me know.

OfficialDyray commented 8 months ago

I feel like adding Nets to the PCB shouldn't be necessary. Won't all the Nets we need exist from importing the schematic? Also- Thanks you for taking the time to write this plugin, I have found it very useful.

gauravmm commented 8 months ago

I think its used to associate traces with nets. I've no idea if KiCAD will infer the nets automatically, or something else.

OfficialDyray commented 7 months ago

Under kicad 6.0 nets.AppendNet() appears to add a new net to the NETINFO_LIST:

>> import pcbnew
>> board = pcbnew.GetBoard()
>> nets = board.GetNetInfo()
>> newNet = pcbnew.NETINFO_ITEM(board)
>> newNet.SetNetname("test");

>> board.GetNetCount()
1

>> nets.AppendNet(newNet)
>> board.GetNetCount()
2

We could just return the \<no net> net: board.FindNet(0)

gauravmm commented 6 months ago

I'll take a look at this soon, sorry about the delay. Thanks for figuring this out!

gauravmm commented 6 months ago

We could just return the net: board.FindNet(0)

That works great! Thanks for figuring this out, I'll merge this to master now.