Slaying the Dragon4 Oct, 2011 By: Nancy Spurling Johnson
User Profile: After years spent thinking that AutoLISP programming was a dark art, Adam Sherratt takes it on — and wins.
Editor's Note: An abbreviated version of this article was published in the Fall 2011 issue of Cadalyst magazine.
Adam Sherratt is a senior draftsman on the civils team at engineering consultancy Arup in Brisbane, Australia. In his 15 years as an AutoCAD user, he’d been curious about AutoLISP programming but always believed it was too complicated to attempt. Then this past summer he viewed a video on Cadalyst.com in which Autodesk’s Lynn Allen explained the basics of AutoLISP. He was surprised by how easy it looked, decided to give it a try — and got hooked.
Cadalyst: Tell us a bit about yourself.
Sherratt: I made the move from the United Kingdom to Australia in 2007 after attending a jobs expo in London and having a series of telephone interviews with a few of Arup’s senior staff members here in Brisbane. They agreed to sponsor me to live and work over here. Australian infrastructure projects have continued to power on despite [the poor economy worldwide]. Fingers crossed it stays that way for the foreseeable future, as I have no plans to return to the U.K. just yet. I love it here in Oz — the lifestyle, the landscape, the sunshine, and the people make it a winning combination!
What comes across your desk in a typical day?
My day-to-day job mainly involves receiving markups from project engineers and drafting up 2D plans for all aspects of highway design, be it alignments, drainage, signage, electrical, geo-tech, whatever. Mostly I just use standalone AutoCAD, but with various customizations to suit our clients’ differing standards. We’re currently migrating from AutoCAD 2008 to 2011. Occasionally I use AutoCAD Map 3D to undertake coordinate transformations. I also help mentor junior CAD team members.
Adam Sherratt recently began using AutoLISP in his work as a senior draftsman.
What do you enjoy most about your job? What would you like to change?
I work with a great team of (mostly!) like-minded individuals who take a pride in the quality of their work. The company also holds several social events throughout the year, so as a result I know many of my colleagues socially as well as professionally, which makes for a friendly working environment.
Regarding what I’d like to change: Currently all of our 3D corridor modeling is done on MX and 12D, which then has to be exported to DWG format for drafting up properly in AutoCAD. I would like to see a shift away from this and AutoCAD Civil 3D implemented so all plans, sections, etc. are reflective of the model as it exists in real time. Unfortunately, the powers that be don’t seem too keen to break away from the status quo, so I can’t see this happening anytime soon.
Plus I’d like to get out on site once in a while. Too much sitting in front of a computer monitor can send one a little stir-crazy at times!
You recently began to teach yourself AutoLISP, is that right?
Yes. At my current workplace we have one or two gurus on the subject, but until recently I had always shied away from scripts and LISP routines, as any kind of programming simply seemed like a dark art to me, almost to the point of being a phobia. But being well into my second decade of CAD-ing, I thought I ought to expand my skill set, if for no other reason than to stay afloat with those guys. I’ve been devising my own scripts for maybe a couple of years now and have come to realize how much time (and monotony) they can save on big jobs. When I saw Lynn Allen’s simple but effective introductory AutoLISP tutorials, I thought, “That doesn’t look so difficult after all,” so I gave it a go!
Editor's Note: To view Lynn Allen's introductory AutoLISP videos, visit the Cadalyst Video Gallery at www.cadalyst.com/video; scroll to find installments in the "Enter the World of AutoLISP" series.
Has it been a challenging process?
I have found that the basics are easy to grasp, but as with most things, the deeper I probe, I find the more there is to it. It’s a slow process as I am frequently trying to find a balance between workload and writing new routines. Sometimes it’s quicker to do things the long way ’round than sit there for hours and puzzle over a routine if I’m staring down the barrel of an urgent deadline.
What types of routines have you written so far?
Only simple ones so far — although they have helped me shave time off otherwise tedious tasks.
I’ve written routines for scaling a number of objects to a given scale and for reconfiguring the UCS, and I helped out with one routine to set the draw order in a series of drawings. This last one started life as a script I wrote, but grew into something much bigger and more user-friendly when one of our aforementioned gurus got hold of it and did some fancy programming work with LISP and linked a DVB file [VBA source code] to it — way beyond my limited ken.
Would you be willing to share one of your routines?
I wrote this one after some bright spark had deleted all the pavement hatch boundaries on a rather large xref. It simply recreates a hatch boundary without the need for a dialog box and saves several mouse clicks!
(defun c:RB () (command "-hatchedit" PAUSE "B" "P" "Y") (princ) )
Regarding AutoLISP, what advice would you give to others?
Don't be scared of it. If I can get involved, anyone can!
What are your interests outside work?
I enjoy cycling, running, and weight training on a regular basis, and will give any kind of outdoor pursuit a go when the opportunity arises. I love to travel, but wish I had the time and money to do more of it! I have a keen interest in cosmology and string/M-theory; popular science books litter my household. Being an environmentally aware person, I am a keen supporter of both the Australian Wilderness Society and Whale and Dolphin Conservation Society, and often take part in fundraising events on their behalf.
Anything else you’d like to share?
It’s been emotional.
Know a CAD user we should feature in "User Profile"? Send your suggestion to firstname.lastname@example.org.
About the Author: Nancy Spurling Johnson
Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's Tips & Tricks Tuesdays free e-newsletter and we'll notify you every time a new video tip is available. All exclusively from Cadalyst!
Autodesk Gallery Powers of Design Exhibit: 10**15 Cat's Eye Nebula 23 May, 2013
Load ‘Em Up! Stackers, Conveyors, and Advanced Assembly 23 May, 2013
Excel Hyperlinks & Document Management Tricks 22 May, 2013
New Certification Logos And Certificate Designs Available 23 May, 2013
Cool Tools of Doom n’ Stuff: Episode 22 23 May, 2013