Loading pcbnew/scripting/examples/createFPC40.py +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ pcb.m_NetClasses.GetDefault().SetClearance(FromMM(0.1)) # create a new module, it's parent is our previously created pcb module = MODULE(pcb) module.SetReference("FPC"+str(pads)) # give it a reference name module.m_Reference.SetPos0(wxPointMM(-1,-1)) module.Reference().SetPos0(wxPointMM(-1,-1)) pcb.Add(module) # add it to our pcb m_pos = wxPointMM(50,50) module.SetPosition(m_pos) Loading Loading @@ -52,7 +52,7 @@ module.Add(e) # save the PCB to disk module.SetLibRef("FPC"+str(pads)) try: FootprintLibCreate("fpc.mod") FootprintLibCreate("fpc40.mod") except: pass # we try to create, but may be it exists already FootprintSave("fpc40.mod",module) Loading pcbnew/scripting/examples/createPcb.py +3 −3 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ pcb.m_NetClasses.GetDefault().SetClearance(FromMM(0.1)) # create a new module, it's parent is our previously created pcb module = MODULE(pcb) module.SetReference("M1") # give it a reference name module.m_Reference.SetPos0(wxPointMM(-10,-10)) module.Reference().SetPos0(wxPointMM(-10,-10)) pcb.Add(module) # add it to our pcb m_pos = wxPointMM(50,50) module.SetPosition(m_pos) Loading Loading @@ -41,7 +41,7 @@ pcb = LoadBoard("/tmp/my2.brd") print map( lambda x: x.GetReference() , list(pcb.GetModules())) for m in pcb.GetModules(): for p in m.GetPads(): for p in m.Pads(): print p.GetPadName(), p.GetPosition(), p.GetOffset() Loading pcbnew/scripting/examples/hidePcbValuesShowReferences.py +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ pcb = LoadBoard(filename) for module in pcb.GetModules(): print "* Module: %s"%module.GetReference() module.GetValueObj().SetVisible(False) # set Value as Hidden module.GetReferenceObj().SetVisible(True) # set Reference as Visible module.Value().SetVisible(False) # set Value as Hidden module.Reference().SetVisible(True) # set Reference as Visible pcb.Save("mod_"+filename) pcbnew/scripting/examples/listPcbLibrary.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ lst = FootprintEnumerate("/usr/share/kicad/modules/sockets.mod") for name in lst: m = FootprintLoad("/usr/share/kicad/modules/sockets.mod",name) print name,"->",m.GetLibRef(), m.GetReference() for p in m.GetPads(): for p in m.Pads(): print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.GetOffset() pcbnew/scripting/module.i +2 −7 Original line number Diff line number Diff line Loading @@ -33,11 +33,6 @@ %pythoncode { def GetPads(self): return self.m_Pads def GetDrawings(self): return self.m_Drawings def GetReferenceObj(self): return self.m_Reference def GetValueObj(self): return self.m_Value #def SaveToLibrary(self,filename): # return SaveModuleToLibrary(filename,self) Loading @@ -52,10 +47,10 @@ if type(itemC) is D_PAD: item.thisown=0 self.m_Pads.PushBack(itemC) self.Pads().PushBack(itemC) elif type(itemC) in [ TEXTE_PCB, DIMENSION, TEXTE_MODULE, DRAWSEGMENT,EDGE_MODULE]: item.thisown = 0 self.m_Drawings.PushBack(item) self.GraphicalItems().PushBack(item) } } Loading pcbnew/scripting/examples/listPcb.py +2 −2 File changed.Contains only whitespace changes. Show changes Loading
pcbnew/scripting/examples/createFPC40.py +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ pcb.m_NetClasses.GetDefault().SetClearance(FromMM(0.1)) # create a new module, it's parent is our previously created pcb module = MODULE(pcb) module.SetReference("FPC"+str(pads)) # give it a reference name module.m_Reference.SetPos0(wxPointMM(-1,-1)) module.Reference().SetPos0(wxPointMM(-1,-1)) pcb.Add(module) # add it to our pcb m_pos = wxPointMM(50,50) module.SetPosition(m_pos) Loading Loading @@ -52,7 +52,7 @@ module.Add(e) # save the PCB to disk module.SetLibRef("FPC"+str(pads)) try: FootprintLibCreate("fpc.mod") FootprintLibCreate("fpc40.mod") except: pass # we try to create, but may be it exists already FootprintSave("fpc40.mod",module) Loading
pcbnew/scripting/examples/createPcb.py +3 −3 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ pcb.m_NetClasses.GetDefault().SetClearance(FromMM(0.1)) # create a new module, it's parent is our previously created pcb module = MODULE(pcb) module.SetReference("M1") # give it a reference name module.m_Reference.SetPos0(wxPointMM(-10,-10)) module.Reference().SetPos0(wxPointMM(-10,-10)) pcb.Add(module) # add it to our pcb m_pos = wxPointMM(50,50) module.SetPosition(m_pos) Loading Loading @@ -41,7 +41,7 @@ pcb = LoadBoard("/tmp/my2.brd") print map( lambda x: x.GetReference() , list(pcb.GetModules())) for m in pcb.GetModules(): for p in m.GetPads(): for p in m.Pads(): print p.GetPadName(), p.GetPosition(), p.GetOffset() Loading
pcbnew/scripting/examples/hidePcbValuesShowReferences.py +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ pcb = LoadBoard(filename) for module in pcb.GetModules(): print "* Module: %s"%module.GetReference() module.GetValueObj().SetVisible(False) # set Value as Hidden module.GetReferenceObj().SetVisible(True) # set Reference as Visible module.Value().SetVisible(False) # set Value as Hidden module.Reference().SetVisible(True) # set Reference as Visible pcb.Save("mod_"+filename)
pcbnew/scripting/examples/listPcbLibrary.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ lst = FootprintEnumerate("/usr/share/kicad/modules/sockets.mod") for name in lst: m = FootprintLoad("/usr/share/kicad/modules/sockets.mod",name) print name,"->",m.GetLibRef(), m.GetReference() for p in m.GetPads(): for p in m.Pads(): print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.GetOffset()
pcbnew/scripting/module.i +2 −7 Original line number Diff line number Diff line Loading @@ -33,11 +33,6 @@ %pythoncode { def GetPads(self): return self.m_Pads def GetDrawings(self): return self.m_Drawings def GetReferenceObj(self): return self.m_Reference def GetValueObj(self): return self.m_Value #def SaveToLibrary(self,filename): # return SaveModuleToLibrary(filename,self) Loading @@ -52,10 +47,10 @@ if type(itemC) is D_PAD: item.thisown=0 self.m_Pads.PushBack(itemC) self.Pads().PushBack(itemC) elif type(itemC) in [ TEXTE_PCB, DIMENSION, TEXTE_MODULE, DRAWSEGMENT,EDGE_MODULE]: item.thisown = 0 self.m_Drawings.PushBack(item) self.GraphicalItems().PushBack(item) } } Loading
pcbnew/scripting/examples/listPcb.py +2 −2 File changed.Contains only whitespace changes. Show changes