Eagle CAD 7.7 - purge? - Page 1
Forum section: electronics / projects

author: Renate
author_rank: Super Contributor
timestamp: June 02, 2020, 01:06:17 pm
content: I'm still using Eagle CAD 7.7I've resisted switching over to KiCAD because of the arcane file format.Yes, the XML in Eagle is verbose, but at least clear.I've always found using the enormous libraries annoying.I usually use my own hand-picked/cleaned-up library.Recently I knocked together a schematic of a dozen part taken directly from the stock libraries.I was amazed to see that the schematic file was 0.5 Meg in size.I'm used to CAD programs with a purge command, but it doesn't seem like Eagle has one.Or did I miss it?So I wrote a purger for Eagle.One of the things that I then noticed is that libraries like resistor.lbr have enormous (15K) description fields of gooble-dee-gook HTML.So now my schematic of a dozen parts is down to 40K, a reduction of 93%I guess that in the 21st century we don't worry about file sizes.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: June 02, 2020, 01:20:15 pm
content: I wrote my own PCBCAD package in the 1990's.At that time it was still mostly Assembler so my data structures were full of 16 bit values and 16 bit words full of bit fields.This made it incredibly compact.Most modern stuff uses files full of text so uses up more room.I had a customer email me complaining that my CAD software requires .net framework 4 to be installed on XP before it will run.He complained about the size of it.I had to explain that its part of Windows now anyway and that quite a bit of software requires it to run.Even C++ requires C++ runtime libraries to run.And .net core requires runtime software.Time has moved on and hard discs have grown in capacity and speed.

author: PKTKS
author_rank: Super Contributor
timestamp: June 02, 2020, 01:50:02 pm
content: There is a "thing" called EDIF...Introduced in the late 80s and meant to solvethese issues of formats among EDA packages.Neither one of the great ones even consideredchanging a single bit of code to conform EDIF.Closest one to EDIF was (and always in the advance) OrCADprior to their change to Cadence. OrCAD EDIF support isone (if not the one) of the best.Others went down the hole making each version a morecumbersome version of their own formats. XML is notexception...Although some "translators" can be written basedon templates to convert XML to EDIF... no one everbother to use EDIF already ready.. decades ago.Funny enough to see the problem is still the very same.Nothing changed several decades after EDIF introducedPaul

author: phil from seattle
author_rank: Super Contributor
timestamp: June 02, 2020, 02:25:13 pm
content: so what does your purger do exactly? and are you sharing it?

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 02, 2020, 03:07:54 pm
content: Not sure I completely got what you meant.Eagle XML file format: I have actually written a C library for parsing that, so I've worked closely on the format. I must admit it's rather well structured overall, and contains a lot of useful information that's often missing in many other CAD formats.As far as size goes, Eagle files actually embed all parts that are used in them, so that makes the files 100% stand-alone, but that can make them pretty big too. I don't quite remember if it does embed more parts (from the same library) than what it exactly uses - I think I'm understanding (from what you're saying) that it does. Although it would make files "bloated" (so I get the idea of "purging"), it's also an interesting "feature", as it allows others to actually retrieve potentially interesting parts from a given Eagle file, effectively making any Eagle file (schematic, layout, library) a usable library in itself.

author: rachaelp
author_rank: Unknown
timestamp: June 02, 2020, 04:10:01 pm
content: Quote from: SiliconWizard on June 02, 2020, 03:07:54 pmAs part of storing the specifics of the parts used in the design it will store all variants of those parts, so if you define an SMT resistor with all the footprints form 01005 to 2512 then the libraries embedded in the design will contain all those footprints. It makes it easy to update the design to change the package on something this way. You can actually strip this out if needs be with the library export function in the most recent versions of EAGLE as you can tell it to export only the used packages and then you update the design with the new exported libraries. If saving a few Mb is a concern it's an option, but with modern hardware and disk sizes the space taken up by EAGLE files is minuscule in comparison.Best Regards,Rachael

author: Scrts
author_rank: Frequent Contributor
timestamp: June 02, 2020, 05:11:19 pm
content: Quote from: Renate on June 02, 2020, 01:06:17 pmOf course we don't. You can now buy 4TB HDD or 1TB SSD for less than $100 on Amazon. If you earn $20/hour and you spent more than 5 hours creating your "purge app" - you should've bought a new HDD instead.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 02, 2020, 05:36:27 pm
content: Quote from: rachaelp on June 02, 2020, 04:10:01 pmOh OK! Now I remember more details indeed.Yes, as hinted, Eagle embeds the exact same information for all parts in the design that it does when saving them in a library file. Library files are just particular cases of design files (schematics, pcbs) and contain the same information for parts AFAIR. I think this is actually a pretty handy feature.Now regarding file size, since text files tend to compress very well, I would probably personally have taken the path of just compressing the files instead of "stripping" them. As an example, I just compressed an Eagle schematic file that was about 1.4MB, with 7-zip. It compressed to a mere 94KB...OTOH, stripping them will remove any not directly needed data, and may be better for IP reasons if you're sharing them.

author: ejeffrey
author_rank: Super Contributor
timestamp: June 03, 2020, 05:39:04 am
content: Quote from: Renate on June 02, 2020, 01:06:17 pmOh noes!I just can't imagine a situation where anyone would care about this. EDA tools have enough real problems: they are slow, buggy, crash a lot, have poor user interfaces, lack effective tools to reduce repetitive and error prone work, have confusing interactions between settings and features, and have poorly thought out user interfaces. Some of these might even be related to inadequacies in the file formats. A 500 kb fille is completely meaningless, especially when a generic compression tool will reduce that by 10x as SiliconWizard notes.

author: james_s
author_rank: Super Contributor
timestamp: June 03, 2020, 05:46:19 am
content: Quote from: ejeffrey on June 03, 2020, 05:39:04 amThat was my first thought as well.I mean ok, half a meg for what is essentially a text file is a little crazy out of context, but when you consider a typical hard drive is *at least* 500GB these days half a meg is just nothing. I can attach a file 10 times that size to an email and it takes just a few seconds to get it.

author: Renate
author_rank: Super Contributor
timestamp: June 03, 2020, 02:19:13 pm
content: I guess some people don't like bloat for a personal reason and some don't care.My personal taste goes for lean and mean.Code:C:\>eglpurge test.schFound 9 partsdevices 236packages 236(That's 236 devices and packages removed. Quite a bit for a circuit with 9 parts.)Sure, I'll release this utility.I've just got to give it some spit and polish.Erm, I mean, wipe it down with isopropyl alcohol.Oh, since size doesn't matter, did I mention that this utility is 230 Megs, reguires 2 different versions of .NET and uses 11 extra DLLs?It requires registration, will only work when you are online and continually sends analytics to me?

author: Renate
author_rank: Super Contributor
timestamp: June 04, 2020, 01:02:09 am
content: So, here it is:http://www.temblast.com/download/eglpurge.exeCode:C:\>eglpurge /? UsageC:\>eglpurge test.sch Check, but don't modify anythingC:\>eglpurge test.sch mod.sch Purge, write to other fileC:\>eglpurge test.sch /r Purge, write back to original fileC:\>eglpurge test.sch /r /v Purge, write back to original file, verboseAfter doing a bunch of experimenting, it looks like Eagle does try to get rid of superfluous things.It's just that it never purges devicesets correctly.eglpurge.exe will also work on .brd files.It's just that I could never find a way to pollute a board file.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: June 04, 2020, 11:21:17 pm
content: Quote from: Renate on June 04, 2020, 01:02:09 amThe PCBCAD software I wrote holds component definitions in with the schematic and pcb.It throws out any that are no longer used as it goes along so no need for a purge.All this keep memory and hard disc usage down.I also have a component update command that updates the component and its definition from the library.A more powerful command updates the whole sch or pcb in one go.