The biggest obstacle to learning technology is fear. Well, there really is nothing to fear except for fear itself … and messing up your system!
Let’s be clear, as long as things are backed up, you are not going to break everything. Say it slowly. Say it with me. Say it out loud. “I am not going to break everything.” Whew. Seriously, let me open up the curtain and do what I think is my job here: I want to get you excited about what YOU can do as a coder. Yes, I want expectations to be reasonable, and I’m not advocating paying software companies tons of money for custom code just because it’s “cool.” But you need to start getting a sense of what actually is within your power RIGHT NOW.
All I want to show you this week is just a glimpse behind the curtain in AutoCAD APIs. Next week I can do a class example (either in Visual Studio showing you how to make a simple “Hello World” kind of project or with VBA for Autocad). Just mention in comments here that you want me to show you Visual Studio or VBA for Autocad, and we’ll show it to you here next week.
That will be for Post 3 in the series, next time.
Right now, I want to show you some screen captures from AutoCAD development in Visual Studio. This is .NET code.
Here’s what a little snapshot of AutoCAD code looks like (in Visual Studio, .NET)
You’ll notice right away, the convenient color coding that Visual Studio provides. Not only that, it self corrects … take a look at this line if I have a typo:
If you spotted that I left out the letter “o” in Document Manager, give yourself a cookie. I clipped out my line with blue underlining telling me where I went wrong, but also the Visual Studio real-time Error List window below it, where it tells me exactly what’s going to prevent a build or proper code.
The modern development environment really coddles us programmers these days. Which is a good thing.
Once we get the proper object as a reference, it guides us through a lot! Look here:
I just typed Autodesk then a period:
… then chose AutoCAD from a list:
… then pick ApplicationService:
… then pick DocumentManager:
… pick Document Manager and look at just some of the options you see in that small alphabetical section of methods, events and properties available for the DocumentManager object:
It’s really pretty phenomenal. Without knowing what I’m doing in code, Visual Studio and .NET (and the definition of the AutoCAD API that we’re using at that point, since we’re under Autodesk.AutoCAD.ApplicationServices), the code is guiding me to what I want to do.
Apologies if this installment was too simplistic, but I’m trying to show you (albeit in a static document here) how easy this stuff can be. I’ll step by step walk you through more practical examples shortly, and will be showing you guys in video session (if there’s demand) or at September 2015 SBS PUG Conference.
But I just want to leave you with this. Picture absolutely any command or process that ANY Autodesk product does. Every one of those commands (or even partial processes within those commands) is something that you can do with code. We just have to find you the right APIs, bring it into your project, type the right word to find that “object” … but after that, it’s all intuitive.
Think about this. You can customize anything you want in Autocad.
- Moving documents
- Changing properties
- Any graphical editing like insertion, editing, deleting of blocks, lines or features
- Reading any value from any database on your network
- Looking up any property of any file on your computer or your network
- Truly anything
Dream it up and we can do it through code … whether you take to coding yourself, or you just dream it up and pay somebody to do it for you. It’s all do-able. The first step truly is just realizing you can do it.
So ask yourself, what do you wish you could do in AutoCAD that you can’t right now? Answer that question and that’s all you need to get started.