AutoCAD .NET

  • I looked back and couldn't find a post covering this particular topic and so decided to put something together. It may well have been covered elsewhere (I admit to not having looked) but I felt like throwing some code together, either way. ๐Ÿ™‚ To perform a Boolean operation between Solid3d objects inside AutoCAD, you can use Solid3d.BooleanOperation() on the primary Solid3d, passing in the secondary one. We want to implement commands for Unite (or Union), Intersect (Intersection) and Subtract (Subtraction). Only the last of these needs us to select a primary object explicitly โ€“ as the other two operations are…

  • After cranking out a post per day so far this week on my exploratory integration of AutoCAD with the Leap Motion controller, it's time to wrap up the technical portion of my "Leap Week" (a bit like a Leap Year, geddit? ๐Ÿ˜‰ with a nice, juicy topic: creating 3D geometry inside AutoCAD using the Leap Motion controller. The Leap Motion controller has a couple of key selling points for interacting in 3D space. It's both highly reactive โ€“ they've done a great job of minimising any processing lag to allow you to build highly responsive systems โ€“ and very accurate.…

  • After introducing Leap Motion and seeing some code to make view changes inside AutoCAD, now it's time to start thinking about geometry creation. We'll see two different approaches to compare and contrast. The first โ€“ covered in today's post โ€“ is a very generic integration at the Windows Message-level: as the user's hand hovers over the device, a component inside AutoCAD translates this into cursor movements. Quick and dirty, but hey โ€“ it's in the second approach (probably in the next post) that we'll see an ultimately more compelling, higher-level integration. With the first approach the user will see the…

  • Now that we've introduced the Leap Motion controller, it's time to do something interesting with it. [If you want to cut to the chase, scroll down to the bottom of the post for a video of the results.] The team at Leap Motion has provided a very decent set of language options via the controller's SDK, including Java, JavaScript, Python, C++ and C#. In order to prototype a quick (and perhaps just a little dirty) integration with AutoCAD, I've gone ahead and used C#. I'm currently using v0.7.1 of the SDK, having started with v0.6.6 and migrated my code to…

  • I had this question come in via a blog comment. I would usually suggest asking this type of question on the relevant online forum, but something about it intrigued me: Now i would like to ask you that to post an item showing how to get the vertexs of 2d solid to create a boundary, could you add one which shows exporting the entity to other format like .shp.? My first thought was "wow โ€“ someone still uses 2D solid objects inside AutoCAD! I wonder what the Solid object's .NET API is like?". (Hopefully this comment doesn't start a flood…

  • This post is based on some information provided by Peter Muigg, a developer in Germany Austria who has long been a friend of Autodesk. In fact, if memory serves me well โ€“ and do step in if I'm mis-remembering, Peter โ€“ back in 1995 when I first joined the company, Peter delivered German-language ObjectARX training on behalf of Autodesk. Peter reached out with this tip just before the holiday break: he needed to display a dialog on AutoCAD startup, but found that it was too soon to do so on IExtentionApplication.Initialize() (it's assumed this module is either demand- or auto-loaded,…

  • I've been waiting for this one to be published, as I've been working very closely with the team that has been developing this particular integration: Project Falcon for AutoCAD is now available on Autodesk Labs. The integration is really impressive: they've managed to really push the limits of the AutoCAD transient graphics API with some pretty incredible results. They've used a number of techniques that have also been shared on this blog to get the application working. It's hard to do it justice with pictures โ€“ download it for 64-bit AutoCAD and take it for a spin! Now if I…

  • This was a fun question that came in from James Meading. I genuinely didn't think I'd manage to look into it before the break, but it tweaked my interest during my trip back from the UK: I thought this might be a topic you would be interested in. I do not use ctrl-v for pasting entities, only text to command line. I already tried removing the keyboard shortcuts to ctrl-v via the cui, and that just makes ctrl-v not do anything when command line does not have focus. So I think I need to write a transparent function, make a…

  • I've taken a few days off to visit some very old friends who are back in the UK from New Zealand for the festive season, but thought I'd go ahead and share some code I've been playing with, even if I can't actually tell you what it's for. I can tell you what it does, of course, but I'm using it in conjunction with some other capabilities that I'm probably not allowed to talk about explicitly. Feel free to speculate at your leisure, I may or may not be able to confirm or deny your suspicions (I need to check…

  • I had an interesting question from a member of our Product Support team, last week. They've been working with a number of customers regarding large files resulting from importing DGN data into AutoCAD: it turns out that the internal structure for complex DGN linestyles created by the DGNIMPORT command โ€“ while working very well when the data is "live" โ€“ makes the data difficult to remove once no longer needed. [Quickly, a big "thank you" to a couple of old friends and colleagues. Firstly to Markus Kraus, who helped explain the data structure created by DGNIMPORT, and then to Albert…