AutoCAD

  • I'm back in San Rafael after a tiring – but very rewarding – two days down in Santa Cruz. I've decided to rattle out a quick post – inspired by this recent comment – before heading out for dinner, so I hope my brain isn't playing tricks on me when it says the code's good enough to post. Please do let me know if you see anything wrong with it. Here's the question: Kean, I am wondering how to do this on table objects. When importing a table from excel as pasting special ACAD objects, you can reset the table…

  • Or otherwise named "Creating an AutoCAD jig to dynamically display a guilloché pattern using F#". But then why pass up the chance for a Jerry Maguire reference? 🙂 Anyway, to continue on from last week's post, Doug – who had presented the original challenge – went on to suggest that I give it the same treatment as Spiro. Basically to implement a jig to display the guilloche pattern dynamically as you input the various options. I understand the difficulty in understanding the nature of the geometry being created in the previous version… the fact that I'd named the original variables…

  • Here's a fun one to finish up the week. And no, it isn't a belated April Fool's gag. 😉 I should probably say right away that you won't be printing money after reading this blog post, but you might know more about some of the security measures used by those who do. A couple of weeks ago, I received an email from Doug Bell at PaperMoneyWorld.net: I have tried your Spiro for AutoCAD and I enjoy it very much. I would like to challenge you to another function I would like to see that is related to the spirograph. I'd…

  • As a follow-on from the last post, in today's we're going to look at a crude approach for collecting execution information about functions of your choosing from a .NET app inside AutoCAD. We're going to extend the implementation shown last time to record the time taken for the various "instrumented" commands to execute and make it easy to copy and paste this "performance" data into a tool such as Excel. We could also dump out a file directly that can be imported into Excel, but this way is simpler and only slightly more manual. It's important to note the quotes…

  • Late last week I received an interesting email from Bruno Saboia, who's been experiencing some performance issues with code he'd written to return all the objects of a particular type – in his case, Lines – from the model-space of the active drawing. We exchanged a few emails on the topic, and Bruno kindly allowed me to post his code and my suggestions for changes. In today's post, we're going to look at both the code and my suggestions, while in the next post (in this mini-series, at least) we'll look at a simple execution framework that can allows you…

  • After introducing the new JavaScript API as one of the new features in AutoCAD 2014, in the last post we looked at a simple command defined using JavaScript. In this post, we're going to implement a simple, palette-based UI inside AutoCAD using HTML5 and JavaScript. Let's start by looking at the HTML code (with the JavaScript embedded, for simplicity): <html>   <head>     <title>Draw a transient circle or rectangle</title>     <script       type="text/javascript"       src="http://www.autocadws.com/jsapi/v1/Autodesk.AutoCAD.js">     </script>     <script type="text/javascript">         // Some global variables        …

  • As promised in yesterday's post, here's my first attempt at writing a simple JavaScript app for AutoCAD. This app is purely JavaScript – no HTML to be seen, anywhere – and implements a command inside AutoCAD that will zoom to the extents of an entity selected by the user. Let's start by looking at the source code, which has been posted here. // Command to zoom to the extents of a selected entity   function zoomEntity() {   try {       // Set the options for our user prompt       var peo = new Acad.PromptEntityOptions();     peo.setMessageAndKeywords("\nSelect an…

  • Today is the official launch of 2014 family of products. AutoCAD 2014 will be available in the coming days to customers around the world. You'll no doubt find lots of information on the interwebs regarding the product's features, so I'm going to focus specifically on the opportunities – and requirements – the new release presents to developers. Firstly, ADN members should refer to the (as ever) thorough information produced by the DevTech team and posted under the "Events" section of the ADN website. I expect the AutoCAD DevBlog will be making much of this available to a broader audience over…

  • OK, here goes: my first (public) attempt at integrating the brand new Kinect Fusion functionality – made available this week in v1.7 of Microsoft's Kinect for Windows SDK – into AutoCAD. There are still a few quirks, so I dare say I'll be posting an update in due course. As mentioned in the last post, I've been working on this for some time but can now show it publicly, as the required SDK capabilities have now been published. As part of this effort, I've gone ahead and made sure the other Kinect samples I've written for AutoCAD work with this…

  • This is very exciting: v1.7 of the Kinect for Windows SDK is being released today and it includes the uber-cool Kinect Fusion component. For those of you who have not yet heard of Kinect Fusion, it allows you to use your Kinect for Windows sensor as an effective reality capture device: it aggregates input from depth frames provided by the Kinect sensor, mapping out a 3D volume. Or, for the layperson, it allows you to paint a 3D model of an existing real-world object or scene into your computer's memory. Here's a video from Engadget's Expand event, held over the…