Kean Walmsley


  • About the Author
    Kean on Google+

July 2014

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    








June 23, 2014

Thinking about security – Part 2

Safe

In the first post in this series, we talked a little about product security in AutoCAD and why having a JavaScript API doesn’t make AutoCAD less secure. We also took the chance to talk about the SECURELOAD mechanism, mainly saying that it’s a good thing.

Today we’re going to talk about why it’s such a good thing.

The various product teams at Autodesk have been very focused on improving security in our products over the last couple of years. We’ve hired a number of key security-focused architects and engineers who are working to improve the level of security we have in our desktop, mobile and cloud-based technology. Individual product teams have also become much more focused on security: I attended a “security summit” along with a number of colleagues during my last visit to San Francisco, for instance, and lots of us are attending security-related training.

Why are we doing this? The world is a very different place than it was just a few years ago. Malware is no longer about teenagers in their bedrooms modifying macro viruses and experimenting with rootkits: it’s about professional cybercriminals and corporate/governmental espionage. Organisations such as Autodesk have a duty to their customers to reduce the risk of attack and to increase their ability to respond when they happen.

Let’s take a few recent examples…

This blog is hosted by Typepad, which over the last few months has been a major target for DDoS attacks. Much to readers’ (and my own) frustration, the hosting of this blog was seriously flakey during a number of weeks, a few months ago. It turns out the reason was that – along with a number of other sites – Typepad was being held to ransom: unless they paid an undisclosed sum, the attacks would continue. And the fact the service was impacted consistently over such a long period was just a testament to the amount of damage it was possible to inflict, despite the best efforts of those involved.

Another example is the recent “Oleg Plissransomware attack on Antipodean iOS devices: unless users paid $100 to a certain PayPal account, they were locked out of their iPhones (etc.). It seems the perpetrators have since been arrested in Russia.

According to Verizon’s Data Breach Investigations (DBI) report:

“2013 may be remembered as the “year of the retailer breach,” but a comprehensive assessment suggests it was a year of transition from geopolitical attacks to large-scale attacks on payment card systems.”

In other words there has been a shift from cyber-espionage to cyber-crime (although both are very much happening, have no doubt). It seems that as it becomes clear there’s significant (and easy) money to be made, criminals move in.

But this is just affecting websites and hosted services, right? Not necessarily: consider how valuable your IP is to you, and what you would pay either to get it back or stop it from falling into the wrong hands. If that’s a significant amount, there’s clearly opportunity there for criminal gain.

Storing data on internal, corporate networks is no guarantee of data security: all it takes is a targeted spear-phishing attack, getting someone to click on an innocent-looking link or attachment, and the network is compromised. And while it all seems like the kind of thing that only happens to other people, as the tools become more readily available and the barrier of entry lowers, we all have to be vigilant.

Autodesk’s responsibility, when it comes to our desktop software, is to do our best to make sure it isn’t an attack vector for malware. We’re clearly not going to be able to do anything about someone running a dodgy executable they downloaded from the web, but we need to make sure that users of our software are informed appropriately when they do something risky (such as loading an application from a location their IT administrators or CAD managers do not consider trustworthy). We can also do our best to make sure that when people download DWGs that opening them doesn’t cause problems, of course.

Please consider this when you disable the SECURELOAD mechanism rather than looking at options for AutoCAD to consider your applications to be trusted.

I don’t mean to be alarmist, but it is important for people to take cyber-security seriously. To get some additional context on issues that relate to security – and, particularly, individual privacy – then I really recommend reading anything you can find by Cory Doctorow, blogger, journalist, sci-fi author and co-editor of Boing Boing.

Cory Doctorow in his office

When I say Cory writes sci-fi, it’s mostly near-future science fiction based on today’s technology (or where it’s likely to go in the foreseeable future). That said, he also writes stuff that’s a bit more “out there”, such as his recent collaboration with Charles Stross (another favourite author of mine).

Before I get to my “Cory Doctorow summer reading list”, the main reason I wanted to mention this author is a speech he gave a couple of years ago for The Long Now Foundation. The speech is still available for subscribers – I watched it when it was still freely viewable – but it’s now only freely available in audio form (listen to it below).

It mainly focuses on issues related to individual property rights and the desire/need for control of devices that we’re increasingly attached to and surrounded by. But security is definitely a significant theme, and it had me thinking hard about the meaning of “trustworthiness”. While you’re at it, his recent TEDxOxbridge talk – which covers many of the same themes – is also well worth a watch.




Thought-provoking stuff. If you have the time to listen through to the Q&A session, at the end, you’ll learn about some of the books Cory has written. Here are a few that I’ve read and recommend. Most are released under a Creative Commons license, so you don’t even need to pay for them (although you may end up wanting to, as I did).

Cory’s clearly a visionary and political commentator but what I like about his work is that it’s infused with humanity. These are important topics told in a way that resonates strongly and leaves you thinking about the future.

Little Brother

Set in San Francisco, this is all about a technically astute young adult (the book’s target audience, by the way) who, while playing a Alternate Reality Game, ends up getting caught up in the wake of a terrorist attack on US soil.

Homeland

The sequel to Little Brother, the protagonist ends up in a job at a local politician’s office. Once again the victim of circumstance, he ends up in possession of some controversial data that he feels obliged to find a way to make public. [Includes a powerful afterword by Aaron Swartz.]

For the Win

How “gold farmers” – online gamers working in virtual sweatshops – end up forming a trade union to protect their interests and those of other workers around the world.

Makers

The US economy collapses, but out of its ashes a phoenix is born: a creative revolution blossoms as people remake a collapsed industrial nation with 3D printers and soldering irons.

The Rapture of the Nerds (with Charles Stross)

In an interesting twist on the traditional story where “believers” get to transcend, this time it’s the geeks who get to upload to the cloud, leaving technological luddites behind to make do with the Earth’s crumbling infrastructure. Great for sci-fi buffs with a sense of humour, it’s The Hitchhiker’s Guide to the Galaxy meets The Light Fantastic.

photo credit (padlock): Anonymous Account via photopin cc
photo credit (portrait of Cory Doctorow): Jonathan Worth, cc

June 19, 2014

8 years

I woke up this morning thinking “it’s about that time of year”. Sure enough, it was eight years ago today that I made the first post to this blog.

Lego cake

[This reminds me that the blog really could use a face-lift, if only for my photograph: I keep meaning to get a new profile snap taken, as I now have significantly more facial hair… nothing too crazy, just a small part of my ongoing southerly follicular migration ;-). And as I’m bound to look older – especially as I’ll forgo the Photoshopping my photographer friend insisted on, last time around – should it really be called a face-lift? Perhaps my blog actually needs a face-drop?]

Many thanks to all of you for your readership. Please don’t forget to continue to post comments, whether via the blog itself or via other social media. It’s your feedback and continued interest that keep the whole thing moving along…

photo credit: CarbonNYC via photopin cc

June 18, 2014

Thinking about security – Part 1

r00tWe’ve been getting some interesting responses back from the AutoCAD Security Survey that has been posted over on the AutoCAD Futures beta forum. (If you haven’t already responded, we’d appreciate you taking the time to do so: it’ll probably take you less time than reading the rest of this blog post. Then please come back and finish reading this, too. ;-) The survey is intended to gauge whether the safeguards we first introduced in AutoCAD 2013 SP1 (and then further enhanced with the SECURELOAD mechanism in AutoCAD 2014) are properly understood and considered valuable.

From some of the feedback we’ve seen so far from the survey, it seems there are people out there who have concerns that introducing a JavaScript API somehow increases AutoCAD’s vulnerability to malicious code. I suspect this is due to the general sense that accessing the Internet is somehow what causes malicious code to infect computers, and that desktop software is inherently safer in nature.

This isn’t quite right. Yes, having computers connected to the Internet does increase their chances of being infected by malware, but it’s just one way of getting malicious code onto your system: aside from the obvious risks of malware coming across on pluggable media (CDs, DVDs, USB keys, etc.) recent research shows that it’s now possible to bridge the air gap, which is just plain scary.

Ignoring that last point, for now, system security ultimately comes down to trust. If you’re running AutoCAD on Windows, you (or perhaps your IT department) have placed trust in Microsoft and Autodesk to provide executable code that behaves in line with your expectations. Every time you install additional software onto your system – or open a DWG file that has been sent to you, more on this later – you are trusting the source of those bits.

Operating systems – especially those in the mobile space – are increasingly sandboxed, which means applications don’t have access to the APIs that could do naughty things on your system (sometimes the user gets the chance to approve or veto, sometimes the APIs are simply not there). This is also partially true on the desktop – where users can run with limited privileges – but to a far lesser extent.

Desktop AutoCAD does not run within an OS sandbox and neither does it provide nor enforce use of its own sandbox for applications, so application code that executes inside AutoCAD generally has the privileges accorded to the current OS user. As an AutoCAD user, you need to think carefully before running any custom application code inside AutoCAD, irrespective of the mechanism used to get it onto your system.

Software vendors are increasingly providing curated online marketplaces (a.k.a App Stores ;-) in an attempt to address both the discoverability of applications but also to increase the level of trust users have in them: typically some level of QA has been performed by the vendor to decrease the chances of these applications doing bad things. This is certainly true of Autodesk Exchange, for instance.

Running a custom module that happens to access the internet to download HTML and JavaScript which then gets executed locally isn’t fundamentally less secure than local executable code. In fact the nature of our hosting means that the code can run in the browser sandbox and only call into a limited set of functions that we make available to it. Alright, so these functions allow the HTML/JavaScript to call into .NET or native code, whether exposed as a callable function or a command, but then the application modules need to be present (and trusted) to provide these functions.

And the user isn’t free to browse to any web-page from an AutoCAD-hosted HTML dialog: it’s the local .NET or ObjectARX application that decides which pages to load into the browser, and if that application is doing something malicious then it’s much simpler to do so directly than loading a web-page to do it.

We introduced the SECURELOAD system variable to make people think carefully about the source of the application code they’re loading and running. If you don’t know or trust the source of executable code then you should not run it. Although it’s possible to do so – and it removes the annoyance factor of seeing this dialog on a regular basis – you should not disable the SECURELOAD feature. You should configure it to load modules you trust automatically but leave it enabled, otherwise.

The same goes for drawings you receive from untrusted sources: people may not realise this, but security researchers have found vulnerabilities in our DWG processing code (which have since been patched for AutoCAD 2011-2014 and fixed in AutoCAD 2015) that could allow users to execute malicious code that’s delivered as part of a specially crafted DWG file. We have a team focused on shoring up AutoCAD’s security to reduce the risk associated with this kind of attack, but this is really to point out that users need to think about trust whenever they load an application or open a DWG file from an unknown source.

In the next post I’m going to give some more context as to why all this matters (I would have included it here, but today’s post is already long enough). I’ll also introduce some resources that will hopefully make you think differently about security, as well as serving as some really interesting summer reading (honest!).

photo credit: Schill via photopincc

June 16, 2014

Some useful webinars

Back in May I pre-announced a couple of webinars that I thought to be of interest to readers of this blog. The first was about ReCap, the second was about posting apps to Autodesk Exchange.

ReCap webinar series

The ReCap webinar was actually the beginning of series: at the time of writing five have now taken place (recordings are available for the first four) and two are remaining. Tomorrow’s webinar on “Capturing 3D reality data by flying a camera on a UAV” looks very interesting: after eventually managing to catch up with the edX class I signed up for on “navigation for autonomous flying robots”, this is an area I’m especially interested in. I’m actually hoping to automate the navigation piece of capturing a house with a UAV, but we’ll see how far I get with that. :-)

The Autodesk Exchange webinar has been posted to YouTube, but here it is, in case you’d rather watch it in-place:




Jeremy points out some important takeaways from the presentation on his blog.

A few tidbits that I feel are really worth emphasizing are that you can now make use of an online entitlement API to help secure your application. This is a key piece of capability that we often get asked about, and it’s great to know that there’s now something official in place.

It’s also worth noting the ability to set up a listener for when people pay for your app via PayPal. Hopefully it comes with a handy “ker-ching!” sound (just kidding ;-).

For more information on these, I do suggest watching the recording and checking out the more complete information Jeremy has posted.

June 13, 2014

3 things I learned at last week’s Technical Summit

The Autodesk Technical Summit is an annual, internal, 2-day technical conference for members of Autodesk’s engineering staff. I’ve been lucky enough to attend since 2011 (the first was held in 2010), and have seen the event grow both in breadth and attendance, over the years: this year there were 500 attendees from around the world and some really excellent presentations.

Most years I’ve been at the event as a presenter (I talked about F# in 2011, Kinect in 2012 and then both Kinect Fusion and Leap Motion in 2013): this is the first time I was there purely as an attendee. Which meant I had more time and energy to focus on absorbing content as well meeting with members of various Autodesk engineering teams.

Even with the additional time to attend sessions there were many I couldn’t attend. Thankfully recordings of the sessions get posted for internal consumption soon after the conference, so I’ll go back through the ones I wish I’d been able to attend and report on those, when I get some time.

For now, here are three bits of information I gleaned from some of my favourite sessions from this year’s event. I would write more, but many were clearly about technology that’s currently in development. These three relate to shipping software, so I should be safe. ;-)

 

1. meshmixer allows you to generate hierarchical support structures ready for 3D printing.

The current approach for generating support structures for overhangs – as used by software provided by 3D printer vendors, such as Makerbot’s MakerWare – is pretty crude: lines are drawn straight downwards from the overhang to the printer bed and can result in lots of difficult-to-remove support material.

The man behind meshmixer, Ryan Schmidt, is working to address this: he has delivered an experimental mechanism in meshmixer 2.x that can generate tree-like support for your models’ overhangs.

Here’s an example for the print I talked about in this previous post (which looks a little strange as I couldn’t work out how to position the model appropriate on the printer bed, but that’s down to user error from my part… and it actually serves to demonstrate the principle fairly well, though).

Lego minifig on stilts

If you need help working out how to make use of this capability, check out this video.

 

2. Autodesk VRED uses spectral raytracing to generate more accurate renderings.

It turns out that raytracing based on the RGB spectrum alone will generate inaccurate results under certain lighting conditions. Autodesk VRED – which was at the core of the configurator shown on the Morgan Motor Company stand at the Geneva Motorshow – can make use of spectral data for materials and lights to generate more accurate results.

Spectral materials in VRED

Here’s a quick video to show more.

 

3. 123D Circuits implements Operational Transformation for collaborative circuit editing.

Operational Transformation (OT) has a long history and has emerged as the “go to” technology for implementing Internet-based collaboration. Google has championed its use in Google Docs, for instance, and many other companies have followed suit.

The super-smart team behind 123D Circuits – another technology I’ve talked about before – has made use of OT by integrating ShareJS, a JavaScript-based implementation. They do so by flattening their data structure down to JSON and then use standard OT capabilities to allow dozens of simultaneous users to work on the same circuit design. Very cool indeed.

123D Circuits collaboration

 

These are just a few of the things I learned at last week’s invaluable event. My apologies if they seem a bit random, but then I’m always impressed at the diversity of Autodesk’s product portfolio and all the cool stuff people are working on.

June 12, 2014

Iterating AutoCAD system variables using .NET – Part 2

In the last post we saw some code to exercise to two available system variable enumeration mechanisms in AutoCAD, SystemObjects.Variables and the new SystemVariableEnumerator class.

Today we’re going to take a closer look at these two mechanisms, briefly comparing their performance and results. I took some code from this previous post to measure elapsed time, deleting the “runs” database to simplify the code once I’d realised the performance was basically comparable.

Here’s the C# code, with the updated ESV and ESV2 commands which now create correspondingly named .txt files in c:\temp, rather than printing the results to the command-line (and with Primary/SecondaryType information ignored, to make the output consistent – and therefore diffable – between the two commands):

using Autodesk.AutoCAD.ApplicationServices;

using Autodesk.AutoCAD.ApplicationServices.Core;

using Autodesk.AutoCAD.Geometry;

using Autodesk.AutoCAD.Runtime;

using System;

using System.Diagnostics;

using System.IO;

using System.Text;

 

namespace SystemVariableEnumeration

{

  public class Commands

  {

    public void MeasureTime(

      Document doc, Func<int> func, string name

    )

    {

      // Get the name of the running command(s)

      // (might also have queried the CommandMethod attribute

      // via reflection, but that would be a lot more work)

 

      var cmd = (string)Application.GetSystemVariable("CMDNAMES");

 

      // Start a Stopwatch to time the execution

 

      var sw = new Stopwatch();

      sw.Start();

 

      // Run the function, getting back the count of the results

 

      var cnt = func();

 

      // Stop the Stopwatch and print the results to the command-line

 

      sw.Stop();

      doc.Editor.WriteMessage(

        "\n{0} found {1} {2} in {3}.", cmd, cnt, name, sw.Elapsed

      );

    }

 

    [CommandMethod("ESV")]

    public void EnumerateSysVars()

    {

      var doc = Application.DocumentManager.MdiActiveDocument;

      if (doc == null)

        return;

 

      MeasureTime(

        doc,

        () =>

        {

          int numVars = 0;

 

          using (var sw = new StreamWriter("c:\\temp\\esv.txt"))

          {

            // Use the existing SystemObjects iteration mechanism

 

            foreach (var v in SystemObjects.Variables)

            {

              sw.WriteLine(GetVariableInfo(v));

              numVars++;

            }

          }

          return numVars;

        },

        "variables"

      );

    }

 

    [CommandMethod("ESV2")]

    public void EnumerateSysVars2()

    {

      var doc = Application.DocumentManager.MdiActiveDocument;

      if (doc == null)

        return;

 

      MeasureTime(

        doc,

        () =>

        {

          int numVars = 0;

 

          using (var sw = new StreamWriter("c:\\temp\\esv2.txt"))

          {

            // Use the new system variable enumerator

 

            var sve = new SystemVariableEnumerator();

 

            while (sve.MoveNext())

            {

              var v = sve.Current;

              if (v != null)

              {

                sw.WriteLine(GetVariableInfo(v));

                numVars++;

              }

            }

          }

 

          return numVars;

        },

        "variables"

      );

    }

 

    // Helper function to get the information for a particular

    // variable

 

    private static string GetVariableInfo(Variable v)

    {

      var t = GetType(v.PrimaryType);

 

      var sb = new StringBuilder();

      sb.AppendFormat(

        "{0} ({1}): {2}", // Skip the additional type info

        v.Name,

        t == null ? "null" : t.Name,

        /*v.PrimaryType, v.SecondaryType,*/ v.TypeFlags

      );

 

      if (v.Range != null)

      {

        sb.AppendFormat(

          " [{0}...{1}]",

          v.Range.LowerBound, v.Range.UpperBound

        );

      }

      return sb.ToString();

    }

 

    // Determine the type of a system variable based on

    // the internal representation

 

    private static System.Type GetType(short v)

    {

      Type ret = null;

 

      switch (v)

      {

        case 1:

        case 5001: // RTREAL real number

          {

            ret = typeof(Double);

            break;

          }

        case 2:

        case 5002: // RTPOINT: 2D point X and Y only

          {

            ret = typeof(Point2d);

            break;

          }

        case 3:

        case 5003: // RTSHORT: short integer

          {

            ret = typeof(Int16);

            break;

          }

        case 4:

        case 5004: // RTANG: angle

          {

            ret = null; // Angle

            break;

          }

        case 5:

        case 5005: // RTSTR: string

          {

            ret = typeof(String);

            break;

          }

        case 6:

        case 5006: // RTENAME: entity name

          {

            ret = null;

            break;

          }

        case 7:

        case 5007: // RTPICKS: pick set

          {

            ret = null;

            break;

          }

        case 8:

        case 5008: // RTORIENT: orientation

          {

            ret = null; // Orientation

            break;

          }

        case 9:

        case 5009: // RT3DPOINT: 3D point - X, Y and Z

          {

            ret = typeof(Point3d);

            break;

          }

        case 10:

        case 5010: // RTLONG: long integer

          {

            ret = typeof(Int32);

            break;

          }

        case 11:

        case 5011: // 2D extents of some kind

          {

            ret = typeof(Point2d);

            break;

          }

      }

      return ret;

    }

  }

}

When we run the code we see that the ESV command – the implementation using SystemObjects.Variables – returns the results more quickly but finds only 274 (or 275 with AutoCAD 2015 SP1 installed, as we have the new CURSORBADGE sysvar), whereas the ESV2 command finds 912 (or 913 with SP1) in a timespan that’s basically consistent with the fact there are more variables found. So performance isn’t an issue.

It is interesting (and somewhat reassuring) that the new enumerator finds so many more sysvars than the former mechanism. On the one hand the old collection allows you to modify a system variable’s value via the returned object…

[CommandMethod("TOGCB")]

public void ToggleCursorBadge()

{

  var doc = Application.DocumentManager.MdiActiveDocument;

  if (doc == null)

    return;

  var ed = doc.Editor;

 

  const string curbadge = "CURSORBADGE";

 

  // Get our CURSORBADGE system variable object

 

  var cb = SystemObjects.Variables[curbadge];

 

  // Report its initial value

 

  ed.WriteMessage(

    "\nInitial value of {0} is {1}.", curbadge, cb.Value

  );

 

  // Set the new value, toggling between 1 & 2

  // (with too many casts for my liking, but hey)

 

  cb.Value = (short)((short)cb.Value == 1 ? 2 : 1);

 

  // And report the new value to make sure it worked

 

  ed.WriteMessage(

    "\nNew value of {0} is {1}.", curbadge, cb.Value

  );

}

… but on the other hand this is really only for a subset of system variables (and I haven’t yet worked out which subset… I do know the new enumerator skips anonymous sysvars, and yet it still finds more than 3x the number).

In case you want to dig into the sysvars returned by each, here are the results for the ESV and the ESV2 commands. I did my own diff – and the results are returned in a consistent order, in that the ones found by ESV are at the end of the ones found by ESV2 – but I haven’t yet spent much time working out which ones are excluded from the old mechanism and why.

If anyone does look into this, please do post a comment: I’ll also post an update if I find out something further from my side.

June 10, 2014

Iterating AutoCAD system variables using .NET – Part 1

On my flight across to Toronto, I took another look at the “What’s New in AutoCAD 2015” section of the .NET API documentation and decided to dig into the new SystemVariableEnumerator implementation.

I was particularly curious about this feature as there is already a way to get access to system variables via the Autodesk.AutoCAD.Runtime.SystemObjects.Variables collection. As an initial look at these two classes, I decided to put together a couple of simple variable iterator commands that use the same function to print out some information concerning the system variables exposed by each collection.

Here’s the C# code implementing two commands, ESV and ESV2, which use the two mechanisms for getting the list of AutoCAD system variables:

using Autodesk.AutoCAD.ApplicationServices;

using Autodesk.AutoCAD.ApplicationServices.Core;

using Autodesk.AutoCAD.EditorInput;

using Autodesk.AutoCAD.Geometry;

using Autodesk.AutoCAD.Runtime;

using System;

 

namespace SystemVariableEnumeration

{

  public class Commands

  {

    [CommandMethod("ESV")]

    public static void EnumerateSysVars()

    {

      var doc = Application.DocumentManager.MdiActiveDocument;

      if (doc == null)

        return;

      var ed = doc.Editor;

 

      // Use the existing SystemObjects iteration mechanism

 

      foreach (var v in SystemObjects.Variables)

      {

        PrintVariable(ed, v);

      }

    }

 

    [CommandMethod("ESV2")]

    public static void EnumerateSysVars2()

    {

      var doc = Application.DocumentManager.MdiActiveDocument;

      if (doc == null)

        return;

      var ed = doc.Editor;

 

      // Use the new system variable enumerator

 

      var sve = new SystemVariableEnumerator();

 

      while (sve.MoveNext())

      {

        var v = sve.Current;

        if (v != null)

        {

          PrintVariable(ed, v);

        }

      }

    }

 

    // Helper function to print out the information about

    // a particular variable

 

    private static void PrintVariable(Editor ed, Variable v)

    {

      var t = GetType(v.PrimaryType);

 

      ed.WriteMessage(

        "\n{0} ({1}, {2} - {3}): {4}",

        v.Name,

        t == null ? "null" : t.Name,

        v.PrimaryType, v.SecondaryType, v.TypeFlags

      );

 

      if (v.Range != null)

      {

        ed.WriteMessage(

          " [{0}...{1}]",

          v.Range.LowerBound, v.Range.UpperBound

        );

      }

    }

 

    // Determine the type of a system variable based on

    // the internal representation

 

    private static System.Type GetType(short v)

    {

      Type ret = null;

 

      switch (v)

      {

        case 1:

        case 5001: // RTREAL real number

          {

            ret = typeof(Double);

            break;

          }

        case 2:

        case 5002: // RTPOINT: 2D point X and Y only

          {

            ret = typeof(Point2d);

            break;

          }

        case 3:

        case 5003: // RTSHORT: short integer

          {

            ret = typeof(Int16);

            break;

          }

        case 4:

        case 5004: // RTANG: angle

          {

            ret = null; // Angle

            break;

          }

        case 5:

        case 5005: // RTSTR: string

          {

            ret = typeof(String);

            break;

          }

        case 6:

        case 5006: // RTENAME: entity name

          {

            ret = null;

            break;

          }

        case 7:

        case 5007: // RTPICKS: pick set

          {

            ret = null;

            break;

          }

        case 8:

        case 5008: // RTORIENT: orientation

          {

            ret = null; // Orientation

            break;

          }

        case 9:

        case 5009: // RT3DPOINT: 3D point - X, Y and Z

          {

            ret = typeof(Point3d);

            break;

          }

        case 10:

        case 5010: // RTLONG: long integer

          {

            ret = typeof(Int32);

            break;

          }

        case 11:

        case 5011: // 2D extents of some kind

          {

            ret = typeof(Point2d);

            break;

          }

      }

      return ret;

    }

  }

}

We won’t look at the output to the command-line in this post, as there’s a lot there. Hopefully the format of the data printed to the command-line is obvious from the code.

A big chunk of this code actually “decodes” the type information, returning a System.Type object when it can make sense of the number passed in (which may be a 50xx number or a shorter enumeration, depending on which mechanism has been used).

It’s also worth noting that it wasn’t quite as simple as doing a “foreach” on the new API: it seems there’s a GetEnumerator() method missing which means we can’t simplify our code in that way, unfortunately (hence the long-hand approach using MoveNext() etc.). Hopefully someone will tell me I’ve made a mistake somewhere in my code and that it is, in fact, possible. :-)

The newer enumerator skips over “hidden” system variables – those with an asterisk (“*”) prefix on their name – which do get returned as part of the SystemObjects collection.

The SystemObjects collection does allow you to set the value of a variable, which is pretty interesting. In a future post we’ll take a look at this capability as well as comparing the performance of the two mechanisms, to see which is most efficient.

June 06, 2014

Toronto

I’m nearing the end of my trip to Toronto: our annual internal Technical Summit was a great success – there were 500 attendees, this year, and as always is a really good opportunity to find out about other parts of the organisation and to meet new people – and today I’ve been hanging out at a specially hosted open house at Autodesk’s King Street office.

The photo boothTo mark the end of the summit, last night there was an event at the Ontario Science Centre, where we had lots of fun experimenting with some interesting “reality capture” technology.

They had a special photo booth where you had your picture taken and pixelised into a low-res monochrome representation which was then used to feed a set of water-filled tubes with bubbles for the pixels.

It wasn’t always very clear in the room, but came out pretty well if you took snaps using your mobile phone:

Bubbles rising

And the Oscar for the best beard goes to..So far today’s open house has been great: various Toronto-based teams – such as the Alias, Maya, PLM 360 and Autodesk Research teams, to name a few – have set up booths and shown people the work they’re doing.

There was even an opportunity to have your picture taken holding an actual Oscar, an “Academy Award of Merit” Autodesk received in 2002 for the Maya product.

That’s it from me, for this week: next week I’ll be back digging into some more technical issues.

June 04, 2014

Autodesk Screencast

There’s been an interesting project on Autodesk Labs for some time, now, called Project Chronicle. It allows you to document use of Autodesk software, whether to provide support, training or – for that matter – to blog about it.

Anyway, this technology has now graduated from Autodesk Labs and is available as Autodesk Screencast. It seemed like a good time to take it for a spin.

Screencast Logo

Autodesk Screencast is about both creating recordings but also the hosting mechanism required to serve these up. If you go to the web-site you can download the recording tool but also see a gallery of existing recordings:

Autodesk Screencast site

Autodesk Screencast will capture recordings of pretty much any software, but to get command-level information you need to have a special plug-in installed. Just make sure the AutoCAD plug-in is selected when you install Screencast:

Installing Screencast

Once installed, the simplest way to launch Screencast is from within AutoCAD, from the Add-Ins ribbon tab:

Launching Screencast from within AutoCAD

Once logged into your Autodesk account, you should be able to use the dialog interface to record working inside AutoCAD:

Recording dialog

The dialog has noticed that the recording dimensions aren’t in the ideal 16x10 ratio, so it will offer to fix this before you record. Clicking the button next to the application name will do so before getting a warning.

Once you’ve completed your recording, edited and uploaded it, you’ll be prompted with a link to it on the Screencast site:

Recording completed and uploaded

Once processed, you can get an embedding code from the site (although I had to calculate the dimensions to keep the aspect ratio manually for the width of my blog, something I’ve gotten used to not doing with YouTube).

Here’s a quick demo video of me using AutoCAD with a custom command to jig an associative hatch using code we saw in this recent post:




There you have it. I can see myself using this tool more often when sharing videos of using Autodesk software in the future.

June 02, 2014

Mountains and MOOCs

Last week was very quiet for me: starting with Memorial Day in the US meant a gentle start for me in Europe, too, and the week ended on Wednesday evening as we then had our own long weekend for Ascension, here in Switzerland. It was nice to have some time off just before a work trip: I’m getting up before dawn tomorrow to head across to Toronto for Autodesk’s annual internal Technical Summit (generally a really interesting and useful event – I’m very much looking forward to it).

Over the last few years – as those of you who follow me on Twitter may know – I’ve been heading up on a regular basis to the Bernese Oberland (mostly on weekends) with my family. It’s a gentle 1.5 hour drive from our home, making it very accessible.

My final professional activity of last week was our regular team meeting, which I took from the road (my wife was driving). I mentioned I was heading up to the mountains, which my boss said always makes him think of “The Sound of Music”. In fairness he’s not actually far from the mark. Although I fear that if my family and I started singing in chorus we’d only raise eyebrows and scatter the local wildlife. :-)

The hills are alive with pollen, anyway

I’d planned on catching up on some MOOC-related work over the long weekend, but the weather was so nice that it ended up having to wait until our return on Sunday.

As I’ve mentioned before, I’ve been plugging away on a few different MOOCs in my spare time. Here’s what I’ve worked on, so far:

I haven’t talked about the last one, as yet. It’s one I’ve taken to shore up my knowledge of embedded systems: writing software that integrates with hardware is a very different skill, so this is helping exercise that part of my brain. The latest Lab exercise involved programming a virtual robot (an iRobot Create, a programmable sibling of the Roomba) to climb hills, determining the incline via its onboard accelerometer and avoiding obstacles based on various other sensor readings.

Driving a virtual robot up hills

Fun stuff, but also very valuable for my research on using SensorTag accelerometer data to drive AutoCAD, something I’ve proposed as an AU 2014 class.

I’m basically done with these robotics-related classes, at this stage, which is a bit of a relief. I’d originally been concerned about the theoretical focus of “Autonomous Mobile Robots” but I ended up managing to keep up with the assignments fairly well. I’ve also completed most of the “Cyber-Physical Systems” assignments (enough to scrape a “pass”, anyway), so that will soon be finished, too.

There’s a really interesting class being delivered by TUMx (the University of Munich) called Autonomous Navigation for Flying Robots. This one actually costs money to get a certificate ($50), so I’ve thus far only signed up to audit the class (although that has as much to do with timing as the cost). The materials look really interesting, though, so I’ve downloaded 4 weeks worth of lecture that I’ll try to dig into on my trip across to Toronto.

As you can probably see, I’m a huge fan of MOOCs, although I admit it can be hard to find the time to work through them. I recommend taking a look at some of the online classes that are available: you can very often get access to top quality material by just auditing classes, assuming you don’t feel you have the time to keep up with the homework assignments.

10 Random Posts