EngCel – Being Brunel http://www.beingbrunel.com The Civil Engineering Blog Sat, 20 Aug 2016 15:22:38 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.9 http://www.beingbrunel.com/wp-content/uploads/2016/05/cropped-being-brunel-512-1-50x50.png EngCel – Being Brunel http://www.beingbrunel.com 32 32 Microsoft Office for Engineers http://www.beingbrunel.com/microsoft-office-engineers/ http://www.beingbrunel.com/microsoft-office-engineers/#respond Mon, 10 Mar 2014 09:50:51 +0000 http://www.beingbrunel.com/?p=2162 Being Brunel | The Civil Engineering Blog

Did you know that I maintain (adj. to sporadically apply fixes that break everything) three add-ins for the Microsoft Office suite? Each one borne out of a frustration with the software from continued exposure...Read More

The post Microsoft Office for Engineers appeared first on Being Brunel.

]]>
Being Brunel | The Civil Engineering Blog

Did you know that I maintain (adj. to sporadically apply fixes that break everything) three add-ins for the Microsoft Office suite? Each one borne out of a frustration with the software from continued exposure to an engineering environment. Well, a few days ago I found some time to work my way through some of the feature requests and bugs people had (so kindly) discovered, so now seems as good a time as any to (re-)introduce these usual suspects…

EngCel – Engineering for Excel

In a nutshel, EngCel provides you with a convenient syntax for writing out engineering equations and symbols in Excel. As you type (hopefully) familiar characters, such as ^ (for super-script) and _ (for sub-script) EngCel will apply the wanted formatting, as well as substituting keywords such as ‘\alpha’ for the right Greek and mathematical symbols. Just to top it off, EngCel also allows you to colour your formulae by dependency, and quickly mix-in common templates (like pass/fail).

Click to view slideshow.

You can find out a bit more about EngCel from previous posts:

Download EngCel Here

preDict – Predictive Text for Word

It might come as a surprise to anyone who hasn’t looked too hard at this blog, but if there’s one thing I really hate, it’s extended writing. There are few things more daunting than a blank page, and as an engineer writing technical reports- I see a lot of them! That said, a lot of engineering reports say the same thing, which is why I wrote preDict. My own copy of preDict is now so trained to me, that all I really need do these days is write a few key words and hold the tab button down to generate enough nonsense to get me started on writing another damn paper!

Click to view slideshow.

This latest update to preDict is fairly substantial (although it will still work with any old dictionaries). Everyone who was asking will be pleased to learn that I’ve finally gotten my hands on a copy of Office 2013 (isn’t it beautiful?) and fixed the compatibility issues. Anyone who doesn’t speak English will also be glad to hear that preDict now respects the language of the document, however prediction memory (i.e. guessing the next word) is still limited to Latin /[A-Za-z]/ characters.

You can find out a bit more about preDict here:

Download preDict Here

postBox – Outlook Time-Savers

Outlook, love it or loath it; you most probably have to use it. postBox is a collection of the two macros I wrote to save me from the RSI of forever repeating the same basic e-mail manoeuvres. The first, QuickLink, converts any text to a link; something that Ctrl+K almost does, but annoyingly fails to do properly if you’re referencing a file on a shared network. The second, ScanAttach, takes that e-mail the scanner gave you (with the bewildering attachment name) and pulls the PDF onto a new e-mail whilst allowing you to give it a name that makes you look half-way proffessional.

postBox on the Outlook Menu

postBox on the Outlook Menu

Because Microsoft has yet to find a way to tell the difference between code that is trying to kill you and your family, and code that you’ve put their yourself to make your life easier; installing postBox is less trivial than preDict or EngCel. For that reason I really recommend you RTFM; you can find detailed guidance on getting postBox working here.

Download postBox Here

The post Microsoft Office for Engineers appeared first on Being Brunel.

]]>
http://www.beingbrunel.com/microsoft-office-engineers/feed/ 0
Programming Civil Engineers http://www.beingbrunel.com/programming-civil-engineers/ http://www.beingbrunel.com/programming-civil-engineers/#comments Thu, 30 Jan 2014 22:24:54 +0000 http://www.beingbrunel.com/?p=2044 Being Brunel | The Civil Engineering Blog

The world of engineering has been becoming progressively more digital; with monstrosities such as ProjectWise entering the common vernacular (verb. to make someone else's document control...Read More

The post Programming Civil Engineers appeared first on Being Brunel.

]]>
Being Brunel | The Civil Engineering Blog

The world of engineering has been becoming progressively more digital; with monstrosities such as ProjectWise entering the common vernacular (verb. to make someone else’s document control your problem). As such, being able to make a computer sit-up and dance (metaphorically, of course) is likely to make your life a much brighter place. So this week, I thought it would fun to share some tips of direction for engineers who find themselves tempted by the dark-side of automation…

Get Yourself A Good Editor

It is a depressing fact that a lot of the programming Engineers are exposed to are scripting languages; and as such they tend to discover that Notepad will open most script files and then stop. This is akin to discovering the ‘+’ button on your calculator, and leaving it at that. Your programming life will be substantially improved if you pick-up an editor that was written after 1985. To help you along, here are three free (and typically portable*) editors I’d personally recommend:

  • NotePad++ Probably the easiest, it’s like NotePad, but with all the pretty colours (syntax highlighting) that make life in another language so much easier.
  • Sublime Text This is my editor of choice, it’s a little more advanced than NotePad++, and thus a bit more complicated. But with a plug-in system you could drown in, and the ability to write in multiple places at once; I’d say it’s worth the learning curve.
  • Visual Studio Express If you find yourself getting hardcore at programming, Microsoft give away a cut-down version of their professional programming software. It should be noted that Visual Studio is pretty much the only Microsoft package I have anything nice to say about…

*Portable Apps are those that anyone (even without administrative rights) can install on a computer. I definitely forbid you from looking at PortableApps.com where you won’t find a range of applications that fill every one of those needs your IT Administrator has been needlessly blocking for years…

Learn By Doing

Just as Blain in Predator ain’t got time to bleed; I expect that most engineers ain’t got time to learn. This is where the wonder of recording comes in. A lot of software that provides automation allows users to ‘record’ what they’ve done straight into code. I see this a lot with Excel; and it is a good place to start. A word of warning, however, reading recorded code is pretty much the best way to learn some incredibly bad habits, and plays all too much into the “it works, it must be right” attitude that will quickly find you sitting in a high tower of code without any abstract foundations.

Choosing A Language

I expect the language that most engineers who have programmed used is VBA (this is the Visual Basic that comes packaged with the likes of Excel). VBA is very much like an old dog, it hasn’t learnt any new tricks in quite some time. This means that moving from VBA to another language can be a bit intimidating; especially when people start throwing words around like Generics and Polymorphism.

I’d say the two cool languages of the moment are JavaScript and C#, the former for web applications (which are a bit of a thing, it seems) and the latter for desktop development. The two friendlies languages I know are Python and Ruby, which are both fairly forgiving. If you want to stick with the world of VB, you can try your hand at VB.NET which is just similar enough to be entirely baffling, and VBScript; which is fairly archaic, but much closer to VBA.

Ultimately, for engineers, I expect most times you’ll be tempted to program you’ll be trying to automate from inside of something (e.g. Excel Macros), and then you’ll be tied in to using a specific language; although breaking out isn’t hard to do. If you find yourself doing something from outside a framework, however, I’d recommend pointing yourself towards Python (or C#, if you’re aiming for higher things).

Some Of The Magic Words

Just as Civil Engineering has it’s Larssen piles, arc welding and PPPs; programming has its own collection of keywords and made-up acronyms. Whilst I’m not proposing to list them all, it might be worth giving a nod to those that are most likely to be that unknown search term that sorts out that frustrating problem…

  • COM is how most programs are able to talk to each other, and despite being invented for Windows 95 it still exists today. If you want to start automating a program from the outside, start searching for COM (although it’s more famous these days as a website suffix…)
  • API or Application Programming Interface is the technical term for all the special functions programmers wrote with the sole purpose of manipulating one program from another. Most major software has something like this (even Twitter).
  • Scripting is an odd one- the simplest difference between a script and a program is that a script is read by a program, and that’s what makes it do something (there are more technical differences). The antithesis of scripted is ‘compiled‘. Crucially scripted programs typically throw errors mid-way through running, whilst compiled programs warn you about them before you start (a bit of a simplification there…).

Learn Where To Get Help

Compared to Programmers, Civil Engineers are as introverted as that guy who stands outside the kitchen at parties. There are tonnes of websites where programmers freely exchange tips, and answer questions. My personal favourite is StackOverflow, which has yet to let me down; and has a massive, friendly, community that includes a lot of top industry programmers.

Another thing that programmers do is share. All you need do is search the vaults of GitHub to find someone who has at least tried to do what you’ve done, and probably done it better. Whilst I’m not claiming to be the best programmer in the world, my GitHub alone has a good few examples of things you can do with LUSAS, Excel, Word and Outlook that’ll leave them doing all your work while you go and make coffee.

So next time you find yourself facing a repetitive task, or sifting through large amounts of data; think- can’t my computer just do this for me. And the answer is most probably yes.

In fact, I’ll got a bit further this week; if you’re interested in automating something, either drop me a comment here, or send me a message on twitter, or Facebook, or whatever– and I’ll happily give you some pointers on how to solve your problem…

The post Programming Civil Engineers appeared first on Being Brunel.

]]>
http://www.beingbrunel.com/programming-civil-engineers/feed/ 9
EngCel: Colours, Names and More http://www.beingbrunel.com/engcel-colours-names-and-more/ http://www.beingbrunel.com/engcel-colours-names-and-more/#comments Thu, 28 Mar 2013 18:59:29 +0000 http://www.beingbrunel.com/?p=881 Being Brunel | The Civil Engineering Blog

EngCel is a free add-in for Excel that I write and maintain. At its core EngCel it's an easy-to-use in-line syntax for super-script, sub-script, Greek and mathematical characters. This week I thought I'd update you all on...Read More

The post EngCel: Colours, Names and More appeared first on Being Brunel.

]]>
Being Brunel | The Civil Engineering Blog

Engcel?

EngCel is a free add-in for Excel that I write and maintain. At its core EngCel it’s an easy-to-use in-line syntax for super-script, sub-script, Greek and mathematical characters and template replacement (called mixins). If you want to remind yourself/learn how it works check out the original EngCel post.

One of the most popular things about this blog (except the amazing drawings, obviously) is the EngCel add-in I shared a few months ago. As with all the software I write, however, it rarely remains static; over time adding new features as and when my frustrations with Excel spur me on. So this week I thought I’d update you all on some of the newest features, and perhaps cajole you into downloading the latest version.

Download the Latest EngCel

 

Colourful Formulae

One of the first things I look for in any development environment is syntax highlighting; and although I’ll happily acknowledge that engineering calculations in Excel isn’t exactly programming, however it’s close enough to be improved by some dynamic colouration (or mod_colour, as EngCel knows it).

Screenshot of EngCel with coloured Excel formula

Colourful Formulae

With the new mod_colour switched on, any new formula will colour depending on its usage:

  • Formulas that are neither used by, or use other cells will turn grey (unused value)
  • Formulas that are used, but not used by, other cells will turn red (input value)
  • Formulas that only reference a single cell, without calculation, will turn orange (refereed value)
  • Formulas that rely and are relied upon by other cells will turn blue (function)
  • Formulas that use other cells but are not used themselves will turn green (result value)

At a glance you’ll now be able to tell which cells aren’t being used, which are the principle inputs and which are the results of a calculation. To enjoy colourful formulae just use the mod_colour mixin |@colour (there’s a ‘u’, I’m English), which will toggle colouring formulae on and off across the application.

Unfortunately, however, it’s a limitation of Excel that you can’t undo the changes a macro makes to your spreadsheet; which essentially means that by switching on mod_colour you’ll lose your undo function. Personally I don’t find this much of a loss compared to the increased clarity gained, but as a result mod_colour is turned off by default.

New Mixins

As well as the pass/fail ok/check mixins EngCel was originally released with, there are now some new ones:

The new Excel mixin templates for Excel

The new EngCel Mixins

  • |@!ok and |@!pass do the reverse of their namesake mixins, which is useful when you’re doing a factor of safety, rather than utilisation, calculation
  • |@eng formats the cell as an engineering number; that is to say something which is grouped in exponents of three, e.g. x103, x106, x109.
  • |@help generates a new sheet which provides an introduction to EngCel. as well as a character map showing you the syntax for the in-line symbols
EngCel Help Tab for Excel

The New Help Tab

At the moment EngCel uses hard-coded mixins; I’m still looking for a way to allow users to safely add their own ones- but at present the limitations of Excel are thwarting my every attempt.

Named Cells

Not too many people know that Excel has the ability to use ‘names’ instead of ‘references’ for cells; e.g. A1 could just as easily be called “first_cell“. For actual tables this doesn’t make too much sense, and therefore the naming method in Excel is a tad cumbersome. For engineering calculations, however, naming cells is a god-send; I don’t know anyone who would prefer to know that D3 = D2*D1, when dead_weight = mass * gravity is readily available.

EngCel now provides an extension to the in-line formatting syntax that allows you to name the cell to the right with the words in the cell to the left; confused? Don’t be. All you need do is write the name of the symbol in the first column, in the adjacent column use EngCel in-line notation to form a lovely looking symbol and follow it with ‘=>’ to name the cell in the next column along. For example, entering the following in Excel:

bad_hal |\Omega_{bad}=> 9000 series
my_hal |\omega=> 9000 series
do_that |\chi_{\omega}=> =if(my_hal=bad_hal,”can’t”,”can”) ?

Results in:

EngCel providing Named formulae for Excel

EngCel Named Formula

As this is pretty much the way every engineer I know writes calculations, it’s pretty easy to get used to and can make coming back to, or checking, a spreadsheet a breeze. Just note the Excel has its own conventions with naming, so stick to unique, character (no spaces) only variable names if you want an easy life.

So that’s it on EngCel latest features. I always keep the GitHub page for all of my software up-to-date, so if you want the latest and greatest features keep an eye on: https://github.com/thomasmichaelwallace/EngCel.

Download the Latest EngCel

 

The post EngCel: Colours, Names and More appeared first on Being Brunel.

]]>
http://www.beingbrunel.com/engcel-colours-names-and-more/feed/ 2
CalcPaper for Excel http://www.beingbrunel.com/calcpaper-for-excel/ http://www.beingbrunel.com/calcpaper-for-excel/#respond Thu, 14 Mar 2013 20:26:59 +0000 http://www.beingbrunel.com/?p=827 Being Brunel | The Civil Engineering Blog

Tom asked if I would like to write a post. I have been impressed with Tom’s office add-ins. Similarly irritated by excel, I thought I too would post some useful excel macros that I have developed to overcome this.
Calculation...Read More

The post CalcPaper for Excel appeared first on Being Brunel.

]]>
Being Brunel | The Civil Engineering Blog

About the Author

Ed Dablin

  • Ed Dablin is a Structural Engineer in the Civil & Infrastructure Business Line of AECOM. Since graduating in 2009, he has worked on the design, inspection and assessment of a number of bridges on a range of projects including including the new Forth Replacement Crossing, Manchester Metrolink tram expansion and a new ring road to Jeddah. He came ‘Highly Commended’ in the 2010 NCE Graduate of the Year Awards.
  • Find out more: Twitter

“Within minutes of the finalists being announced Tony Gee graduate Tom Wallace had researched just about all there was to know about his rivals and, on his personal blog, he had analysed the qualities of the last 10 graduate award winners.”

This is as reported in the 13.12.12 NCE. If Tom is anything like me, he won’t thank me for posting this; (Ed[itor]: no, no I won’t…) I found my article highly cringeworthy. I was very curious to see Tom’s analysis and if I fit into this. Ah, no visit to a sewerage works. This year’s winner Jamie Radford must have had it wrapped up the moment he mentioned faecal sludge. Fair play!

Being Brunel – Tom is not short of audacity. Yet this, like Brunel, could make him a great engineer. I have to say I am enjoying reading his blog, it is evident that Tom puts in a lot of effort. Tom’s thoughts and ramblings certainly resonate with me and I think there is a common sense of humour amongst engineers which Tom’s posts embody. I have subscribed via RSS and I note there is no link for RSS visible on the page but if you too want to subscribe this is it: http://www.beingbrunel.com/feed/ (Ed[itor]: you can also subscribe by e-mail on the right-hand sidebar, but enough about me…).

Having commented on the Awards analysis post, Tom asked if I would like to write a post. I have been impressed with Tom’s office add-ins. Similarly irritated by excel, I thought I too would post some useful excel macros that I have developed to overcome this.

Calculation Paper

I’m a VB novice and much of what I write is started by using Excel’s record macro feature and looking for commands from Google to develop it into something more sophisticated. Often it takes me too long to write and I don’t really save that much time, if at all. However, a couple of people in the office now use it to speed up their work too. One of the first things I wrote was a subscript/superscript macro. However, I have now superseded it with Tom’s EngCel which is a lot less clunky; mine involved user forms.

Anyway, I have modified the stock Excel calculation paper that gets used in the office to something which now enables me to type calculations a lot quicker in Excel. Please see this link if you wish to download the file and have a play. Run setup.bat so it deploys template sheets in your excel template file.

Download CalcPaper

This is a list of the currently working macros (for a list of hotkeys see the excel sheet):

Macro Description
Page Count Numbers all your pages automatically regardless of sheet or page numbers.
PDF to desktop Make a pdf of selected sheets and send to desktop
Select last sheet Like Alt + Tab in windows but with sheets
Unit Picker Shows a user form with common units e.g. N/mm2
Quick Script Quickly superscript and subscript text in cell (I now use Tom’s EngCel add-in over this)
New View Opens another windows and arranges vertically. Very useful when referencing another sheet.
Appendix View Same as above but new view opens in appendix
TOC Automatically create table of contents based on sheet headings
Insert… Inserts pages (Cover Sheet, TOC, New Sheets, Appendices)
Merge and Wrap I like to keep rows and columns fixed and for blocks of text use this feature to quickly make text flow over lines.
Centre Simple but saves useful hotkey.

There are other various optimisations such as print settings and font but I won’t go into those. I have a number of ideas to improve the spreadsheet such as a common symbols user form, an advanced cut and paste facility that will paste even if there are merged cells and optional side reference columns. See log.txt for a list. Unfortunately, I struggle to get the time to implement them but the more people that are interested in it, the more likely I am to develop it a bit more. Any suggestions, please let me know in the comments.

How to Record a Macro

If you don’t know how to record a macro in excel, its alarmingly simple. This is the process I go through:

How to record an Excel Macro

Download CalcPaper

The post CalcPaper for Excel appeared first on Being Brunel.

]]>
http://www.beingbrunel.com/calcpaper-for-excel/feed/ 0
Inline Sub/Super- Script in Excel, and More… http://www.beingbrunel.com/inline-subsuper-script-in-excel-and-more/ http://www.beingbrunel.com/inline-subsuper-script-in-excel-and-more/#comments Thu, 25 Oct 2012 06:57:08 +0000 http://www.beingbrunel.com/?p=248 Being Brunel | The Civil Engineering Blog

I have written an Excel add-in called EngCel which does, however, make engineering in Excel a little more bearable. EngCel provides in-line superscript and subscript shortcuts for excel using the fairly standard ^ and...Read More

The post Inline Sub/Super- Script in Excel, and More… appeared first on Being Brunel.

]]>
Being Brunel | The Civil Engineering Blog

I have already mused on how often engineers use Excel to design; it’s a disproportionate amount, considering that engineering calculations isn’t really what Excel was designed for. This is most noticeable when it comes to engineering notation. Anyone who has attempted to implement a Eurocode design in Excel has probably already despaired at the lack of a sub-script button, or excessive character maps. This has been true for the last 11 versions, and isn’t set to change for the 12th.

I have written an Excel add-in called EngCel which does, however, make engineering in Excel a little more bearable:

Download EngCel

Super/Sub Script

EngCel provides in-line superscript and subscript shortcuts for excel using the fairly standard ^ and _ notations, respectively:

Examples of sub/super -script with EngCel

Examples of sub/super -script with EngCel

In all three of the above examples the text on the left shows what was typed into the cell, and the text on the right demonstrates what it will be converted to with the add-in installed. For example typing “|kN/mm^2” will appear as “kN/mm²“.

The syntax is fairly simple, starting a cell with the pipe (“|“) symbol, (that’s shift+\ on a QWERTY keyboard), indicates that the text contains in-line formatting. The character immediately after an exponent (“^“) will be in super-script, and the character after an underscore (“_“) will be in sub-script.

Sometimes, however, you will want to have multiple characters super/sub -scripted. Anything within curly-brackets (“{” and “}“) is considered a single character. The above examples show how putting “ck” and “-2” within the brackets has made all the enclosed characters super-script.

Symbols

Another gripe I have with the Excel formula bar is that symbols can’t be quickly inserted without going back and forward to the character map. EngCel solves this by adding the following in-line syntax:

Examples of symbols with EngCel

Examples of symbols with EngCel

By writing the name of a Greek character after a backslash (“\“) the actual letter will appear, as shown above. If the name is in lower-case, the letter will be in lower-case; if the name is in proper-case the letter with be a capital. This is demonstrated in the above beta/Omega example. There are also a number of mathematical symbols available, however listing them all would be a bit much for this overview; just try typing the name, chances are it’ll be there (e.g. \plusminus or \middot).

EngCel also allows in-line over-lining. Unlike the other syntax the negation (“¬“) symbol, (that’s shift + the key next to the “1” on the top line of a QWERTY keyboard, i.e. “`“), comes after the letter. This matches how an over-line is referred to in engineering calculations, e.g. x bar; which is also the example shown above.

Remember that all in-line formatting needs a | at the start so that EngCel knows to parse it.

Mixins

Finally engineering calculations have a lot of common and repeated elements. These are refereed to as ‘mixins’ in the EngCel code:

Examples of mixins with EngCel

Examples of mixins with EngCel

In these examples the left cell shows what was typed into the cell, the middle column is a demonstrative number, and the ‘PASS’ and ‘CHECK’ cells show what a cell, in that position, with an EngCel mixin would become. Mixins can be thought of as templates.

To use a mixin type the name of the mixin after the at (“@“) symbol. As using a mixin replaces the entire contents of the cell, a mixin will only work if it is the first thing after the pipe.

At the time of writing only two mixins are supported (both shown above): @pass and @ok. Both convert the cell into a simple utilisation check of the cell two columns to the left. If the utilisation is less or equal to 100% the cell becomes green and says “PASS” or “OK” respectively. If it is greater than 100% the cell becomes red and states “FAIL” or “CHECK”. The pass/fail indicator is commonplace in engineering calculations.

As I come across more elements repetitive enough to justify coding a mixin for EngCel, it will be updated; however the code is OpenSource- so feel free to contribute if you can.

Installing EngCel

Full details of how to install EngCel, and the complete in-line syntax available can be found on the GitHub EngCel Page. As it is an add-in it can be installed by any user on the system, you just need to follow the instructions from Microsoft relative to the version of Excel you have installed.

As a quick guide for 2010 users to load this add-in into Excel, click: File > Options > Add-Ins > Manage: Excel Add-Ins > Go > Browse > [Browse to add-in file] > OK > Tick: EngCel > OK. Why Microsoft has to make things so convoluted I’ll never know…

Once loaded you can enjoy the world of sexy engineering calculation formatting!

Download EngCel

The post Inline Sub/Super- Script in Excel, and More… appeared first on Being Brunel.

]]>
http://www.beingbrunel.com/inline-subsuper-script-in-excel-and-more/feed/ 23