realthunder / fcad_pcb

FreeCAD scripts for PCB CAD/CAM
MIT License
126 stars 25 forks source link

Error in makeCopper() look like an error creating custom pads #62

Closed AlejoPm03 closed 1 year ago

AlejoPm03 commented 1 year ago

When I try to generate the copper layers of this board I have this error message:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "mymacropath/fcad_pcb/kicad.py", line 2036, in makeCopper
    obj = getattr(self,'make{}'.format(name))(fit_arcs=sub_fit_arcs,
  File "mymacropath/fcad_pcb/kicad.py", line 1666, in makePads
    w = self._makeCustomPad(p)
  File "mymacropath/fcad_pcb/kicad.py", line 1587, in _makeCustomPad
    wire,width = makePrimitve(key, getattr(params.primitives, key))
  File "mymacropath/fcad_pcb/kicad.py", line 303, in makePrimitve
    width = getattr(params,'width',0)
  File "mymacropath/fcad_pcb/kicad_parser/sexp_parser/sexp_parser.py", line 175, in __getattr__
    return self.__getitem__(name)
  File "mymacropath/fcad_pcb/kicad_parser/sexp_parser/sexp_parser.py", line 146, in __getitem__
    v = self._value[key]
TypeError: list indices must be integers or slices, not str

Command sequence:

>>> from fcad_pcb import kicad
>>> pcb = kicad.KicadFcad("mypcb/hardware/main/main.kicad_pcb")
>>> pcb.makeCopper()

I tried with a simpler board and it works fine