Lista componentes Kicad

Softwares para design e simulação de circuitos eletrônicos

Moderadores: 51, guest2003

Lista componentes Kicad

Mensagempor ELFS » 11 Mar 2015 21:43

Como gerar uma lista de material com a referencia, valor e footprint sem ter que anotar no esquemático o footprint ( encapsulamento) utilizado para cada componente.
A dificuldade é gerar uma lista que indique se um resistor é tamanho 0805 ou 1206.
Atribuo o footprint manualmente para cada componente só não consigo salvar a lista xxxxx.cmp em um formato adequado.
ELFS
Byte
 
Mensagens: 371
Registrado em: 16 Ago 2007 14:10
Localização: Brasil- Pr- Curitiba

Re: Lista componentes Kicad

Mensagempor B-EAGLE » 14 Abr 2015 14:21

Qual versão está usando e qual o seu SO?

Não tenho certeza se entendi direito o que você quis dizer, mas o que acho mais prático de fazer é o seguinte:

- Adicionar o símbolo no esquemático, por exemplo um resistor.
- Abrir as propriedades desse resistor e adicionar o footprint (módulo), por exemplo 0603.
- Todos os resistores 0603 que colocar dai pra frente, é só copiar este que já vai estar o footprint selecionado, facilitando a associação dos footprints restantes depois...
- Alterar o nome desse componente pra sei lá, 100K/0603/1%, o script que uso agrupa por esse nome.
- Depois rodar um dos scripts em python pra gerar o BOM no formato que vc quer, eu alterei um pouquinho um dos que já vem prontos.. ta em anexo o bixo...

Acho que não consegui entender direito a sequência que vc está fazendo mesmo...

python code
#
# Example python script to generate a BOM from a KiCad generic netlist
#
# Example: Sorted and Grouped HTML BOM
#

from __future__ import print_function

# Import the KiCad python helper module and the csv formatter
import kicad_netlist_reader
import sys

# Start with a basic html template
html = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1><!--SOURCE--></h1>
<p><!--DATE--></p>
<p><!--TOOL--></p>
<p><!--COMPCOUNT--></p>
<table>
<!--TABLEROW-->
</table>
</body>
</html>
"""

# Generate an instance of a generic netlist, and load the netlist tree from
# the command line option. If the file doesn't exist, execution will stop
net = kicad_netlist_reader.netlist(sys.argv[1])

# Open a file to write to, if the file cannot be opened output to stdout
# instead
try:
f = open(sys.argv[2], 'w')
except IOError:
print(__file__, ":", e, file=sys.stderr)
f = stdout

components = net.getInterestingComponents()

# Output a set of rows for a header providing general information
#html = html.replace('<!--SOURCE-->', net.getSource())
html = html.replace('<!--DATE-->', net.getDate())
html = html.replace('<!--TOOL-->', net.getTool())
html = html.replace('<!--COMPCOUNT-->', "<b>Component Count:</b>" + \
str(len(components)))

row = "<tr><th style='width:300px'>Component</th>"
row += "<th>Qnty</th>"
row += "<th>Manufacturer</th>"
row += "<th>Part Number</th>"
row += "<th>References</th><tr>"

html = html.replace('<!--TABLEROW-->', row + "<!--TABLEROW-->")

# Get all of the components in groups of matching parts + values
# (see kicad_netlist_reader.py)
grouped = net.groupComponents(components)

# Output all of the component information
for group in grouped:
refs = ""

# Add the reference of every component in the group and keep a reference
# to the component so that the other data can be filled in once per group
for component in group:
if len(refs) > 0:
refs += ", "
refs += component.getRef()
c = component

row = "<tr><td>" + c.getValue() + "</td>"
row += "<td>" + str(len(group)) + "</td>"
row += "<td>" + c.getField("Manufacturer") + "</td>"
row += "<td>" + c.getField("Part Number") + "</td>"
row += "<td>" + refs + "</td></tr>"

html = html.replace('<!--TABLEROW-->', row + "<!--TABLEROW-->")

# Print the formatted html to the file
print(html, file=f)
B-EAGLE
Word
 
Mensagens: 847
Registrado em: 19 Out 2006 14:12
Localização: Campo Grande - MS


Voltar para Software EDA ( KiCAD, Altium Designer, Protel, Eagle, P-CAD )

Quem está online

Usuários navegando neste fórum: Google [Bot] e 1 visitante

x