Difference between revisions of "Downloading KiCAD files for LCSC components"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
(Created page with "<pre> #!/usr/bin/bash ######################################################## ### This little script wraps around ### ### https://github.com/uPesy/easyeda2kicad.py ### ### and provides a much more usable set of downloads ### ### ### ### Before using, either create an LCSC folder in ### ### your Documents or edit the OUTPUT= line below. ### #####################################################...")
 
Line 1: Line 1:
<pre>
<SyntaxHighlight lang="bash" line>
#!/usr/bin/bash
#!/usr/bin/bash


Line 32: Line 32:
  fi
  fi
done
done
</pre>
</SyntaxHighlight>

Revision as of 16:04, 9 June 2024

#!/usr/bin/bash

########################################################
### This little script wraps around                  ###
### https://github.com/uPesy/easyeda2kicad.py        ###
### and provides a much more usable set of downloads ###
###                                                  ###
### Before using, either create an LCSC folder in    ###
### your Documents or edit the OUTPUT= line below.   ###
########################################################

OUTPUT='Documents/LCSC/'
for i in ${*}
 do
 echo ${i}

 if easyeda2kicad --full --overwrite --lcsc_id=${i} --output ~/${OUTPUT}${i}
  then
   mkdir  ~/${OUTPUT}${i}/
   mv     ~/${OUTPUT}${i}.kicad_sym ~/${OUTPUT}${i}/
   mv     ~/${OUTPUT}${i}.3dshapes/*.step ~/${OUTPUT}${i}/
          # if you really want the WRL also, change the above line to:
          #    mv     ~/${OUTPUT}${i}.3dshapes/*.step ~/${OUTPUT}${i}/
   mv     ~/${OUTPUT}${i}.pretty/* ~/${OUTPUT}${i}/
   rm -r  ~/${OUTPUT}${i}.*
   echo Got it...
  else
   rm -r  ~/${OUTPUT}${i}.*
   touch  ~/${OUTPUT}${i}.HasNoStuffAvailable
   echo Nothing to get...
 fi
done