Author |
Message |
Dougster
Joined: Sep 20, 2005 Posts: 272 Location: Tucson, AZ, USA
|
Posted: Tue Nov 27, 2012 5:27 pm Post subject:
SOLVED: EAGLE users? I'm trying to generate parts lists... |
|
|
Well, the only tools I have found so far output a complete parts list from an entire schematic/board project. (BOM-EX rules BTW!)
However, I have 18 pages of schematics for the project I'm trying to finish up and I'd like to output a separate parts list for each page. That way I have a list of all power supply parts and a separate list of all parts in the BD section, the SD section, etc. So far, I've had to either 1) output a complete list of all parts and edit it to suit, or 2) delete all but the current page of the schematics and output a parts list for it. Neither of these is a particularly optimal solution.
Does anybody know of a User Language Program (ULP) or some way of using attributes or something to make it easier to output a list of all the parts for each section of my design?
Thanks!
Doug _________________ Once you start down the modular path, forever will it dominate your destiny!
Every DIY person should own a copy of Electronotes: http://electronotes.netfirms.com
Blue LEDs are evil. Last edited by Dougster on Wed Nov 28, 2012 5:14 pm; edited 1 time in total |
|
Back to top
|
|
|
Dougster
Joined: Sep 20, 2005 Posts: 272 Location: Tucson, AZ, USA
|
Posted: Wed Nov 28, 2012 5:13 pm Post subject:
|
|
|
OK, I solved it. I posted my script on the EAGLE forum, but figured I'd put it here too, since this is my favorite forum.
EAGLE really has a weird/interesting/nice scripting system. This is a ULP file, which is written in a C-like language. ULPs can go through a library, a schematic, or a board and process almost anything. Interestingly though, you can't actually change anything with a ULP, so you generate a command script that is run when you use the exit() command...
Code: |
#usage "<b>Adds PAGE number attribute to each part on each page of a schematic.</b>";
string Version = "0.10";
string tmp = "";
string Message = "";
string Script = "";
if (!schematic) {
dlgMessageBox("Start this ULP from a Schematic...", "OK");
} else {
schematic(SCH) {
sprintf(tmp, "Schematic Name:\n%s\n", SCH.name);
dlgMessageBox(tmp);
SCH.sheets(S) {
sprintf(Message, "Sheet %d\n---------\nParts:\n", S.number);
S.parts(P) {
sprintf(tmp, "%s\n", P.name);
Message += tmp;
sprintf(tmp, "ATTRIBUTE %s PAGE '%d';\n", P.name, S.number);
Script += tmp;
}
dlgMessageBox(Message); // Dialog box with list of parts on page
}
}
//dlgMessageBox(Script); // Debugging - show script before executing
exit(Script);
}
|
Regards,
Doug _________________ Once you start down the modular path, forever will it dominate your destiny!
Every DIY person should own a copy of Electronotes: http://electronotes.netfirms.com
Blue LEDs are evil. |
|
Back to top
|
|
|
mahjo
Joined: Jan 29, 2013 Posts: 5 Location: Thousten
|
Posted: Tue Jan 29, 2013 2:58 am Post subject:
|
|
|
Hi Doug,
thanks for that script. Do you create ULPs on a regular basis? |
|
Back to top
|
|
|
mahjo
Joined: Jan 29, 2013 Posts: 5 Location: Thousten
|
Posted: Tue Jan 29, 2013 3:20 am Post subject:
|
|
|
Update: I found some useful ULPs here. I didn't know it was that easy to find help. |
|
Back to top
|
|
|
|