Future Plugin of the Month to embed QR Codes in AutoCAD drawings?
I’ve been having a fun discussion with Augusto Gonçalves, based in São Paulo working for our DevTech Americas team, on the subject of QR Codes. Augusto’s a technology junky – like many members of DevTech – and has been playing around decoding QR Codes with his mobile phone.
QR (from “Quick Response”) Codes are two-dimensional bar codes which encode data for later decoding using – very often, at least – some kind of handheld, mobile device. The most common reader applications use your device’s camera to detect and analyse the composition of the QR Code, providing you with the decoded information for you to use as you wish.
These codes really seem to be taking off, and are used to encode a wide variety of data: plain text, URLs, contact information, even GPS coordinates. QR Codes are cropping up on printed documents, advertising billboards and T-shirts (to name but a few places you’ll find them :-). Oh, and it seems Facebook is also getting in on the action.
The QR Code format itself, while originally developed by a company in Japan, apparently remains free of any license costs. There are a number of freely available libraries and web services that can be used to generate QR Codes, such as this one from Google, which was used to develop their Zebra Crossing online generator form (in case you missed the reference, zebra crossing is the term used to describe pedestrian crossings – at least in the UK – which have a one-dimensional, barcode-like pattern :-).
Using Google Chart’s underlying web service it’s trivial to generate a barcode directly from a URL (clicking this one will generate a medium-sized QR Code containing the URL of this blog):
And if you want to decode an QR Code embedded in an image (but you don’t happen to have a SmartPhone handy with a camera and a QR Code reader application installed) then you can also upload an image or provide its URL (if the image is already online) to the Zebra Crossing online decoder. Try it with the image at the top of this post: if you paste the URL to the image into decoder form, you’ll find a hidden message.
Augusto’s question to me was whether it was worth developing a Plugin of the Month to allow people to help embed QR Codes in AutoCAD drawings. Sounds like a great idea, to me! :-)
I can well imagine workflows where people label site plans with geo-location information, for instance, and I’m sure that introducing this capability would enable far more innovative uses for it.
Augusto and I have exchanged a few emails on some possible implementation details for this plugin, but there are a number of outstanding questions that I’m hoping this blog’s readership will be able to provide input on.
- What uses would you make of this, and therefore what kinds of data should be supported?
- Geo-location seems a no-brainer, as does contact information (email address, physical address, phone number), URLs, plain text…
- What kind of features would you like to see? Some thoughts…
- Ability to create a QR Code at a certain location
- Ability to manage previously embedded QR Codes' and edit their contents
- Ability to create a QR Code based on dynamic data such as a string containing fields (date/time or publishing, etc.)
- Would it be preferable to have the resulting code as an embedded raster image or as native AutoCAD geometry?
- It’s possible to do either, but each has advantages/disadvantages…
- Raster images are not embedded directly in the DWG
- They can be defined by a URL, but the file will end up being copied locally to a temporary folder, which would need to happen on each machine
- Native geometry can apparently be determined/created using a library such as this one
- The geometry – probably a series of AutoCAD 2D SOLID objects – is more easily scaled, but also more prone to corruption (at the very least it would need to be grouped in some way)
- There would be no downstream dependency on a web service to generate the image
While you can get QR Codes in your drawing today using IMAGEATTACH and pasting the QR Code’s URL (as generated by your preferred web service), there does seem to be an opportunity to streamline this process and to take it further. Please post a comment and let us know what you’re thinking. :-)