This is fundamentally a great idea for solving the problem of communicating between processes, and it has been a very useful way to automate programs over the years. This would send an instruction to AutoCAD®, through the COM interface, telling AutoCAD® to prompt the user with the text “Hello from Excel!”. Set ACAD = GetObject(, “AutoCAD.Application”)Ī “Hello from Excel!”
#How to rename a block in cad for mac code
What this essentially means is that we can write code in one program (say Excel for example) to automate another program (say AutoCAD).įor example, we could write this VBA code in Excel: It sets out a standard for how programs can interact with each other. This is why Microsoft invented COM, which stands for Component Object Model. If you wanted to access the value of the variable created in one program from the other, you can’t – you’re stuck. However, if you have two programs that run separately, you don’t have access to one program from the other. If you’re creating a program, you can quite easily declare a variable and use it in your code. So that’s the point of this post – to explain the differences, and why it’s generally better to use managed code. Without this fundamental understanding you’re going to get confused at some point why something isn’t working. However, you can create tools for AutoCAD® using VB.NET in many ways, and I often see people unsure about the difference between COM automation and using a managed. Over the years of running I have found that hundreds, if not thousands of you are very keen to get into writing your own tools for AutoCAD®. Pretty trivial, but it’s only indicative of the type of thing I’m aiming for, and hopefully you’re all now intrigued ? Here’s a teaser of the kind of thing I’ve been aiming for:Ī basic example of a syntax that achieves more, with less code. I’ve called it CADBASIC. Its primary design goal from the very beginning has been to create a language that is extremely simple to use.īecause it’s my own proprietary language for AutoCAD®, I have complete control over the syntax of everything, which means if you want a new command or behaviour in the language, I can add it for you, in whatever crazy wacky syntax you like. It is… … … *drum-roll* … A new programming language for AutoCAD! I’d also like to take this opportunity to announce a new project that I have been working on for over a year (woohoo, it’s close enough to being finished that I can mention it!). I hope to get this out to you very shortly (tomorrow, if possible). So due to popular demand, creating an updated version of this tool has become my top priority. A number of you have asked for an updated version of my Survey Fixing utility for Civil 3D®.