설명
주요 학습
- Learn how to create command aliases
- Learn how to create and modify tool palettes
- Learn how to write and run script files
- Learn how to modify the ribbon and Quick Access toolbar
발표자
- LALee AmbrosiusLee Ambrosius is a Senior Principal Content Experience Designer at Autodesk, Inc., for the AutoCAD® and AutoCAD LT products on Windows and Mac. He works primarily on the customization, developer, and CAD administration documentation along with the user documentation. Lee has presented at over 15 different Autodesk University events on a range of topics, from general AutoCAD customization to programming with the ObjectARX technology. He has authored several AutoCAD-related books, with his most recent projects being Discovering AutoCAD 2024, and AutoCAD Platform Customization: User Interface, AutoLISP, VBA, and Beyond. When Lee isn't writing, you can find him roaming various AutoCAD community forums, posting articles on his or the AutoCAD blog, or tweeting information regarding the AutoCAD product.
LEE AMBROSIUS: We'll get started since it's 1 o'clock. Hi.
AUDIENCE: We're going to go to the back now.
LEE AMBROSIUS: You're going back now. I'm making you relocate, yes. Well, you can lay off the stage too, which is fine. It's your choice.
All righty. Let's get started. So everybody should be here in the correct class because they monitor the doors these days and don't let just anybody in anymore. So they should have scanned you into the classroom.
So we're in AutoCAD Customization Boot Camp, just the basics one. So there is a separate one tomorrow and Thursday, I believe, is the next two then. So you should know-- if you're in here, you should know AutoCAD 2020 or earlier. For the most part, the stuff that I'm going to talk about goes all the way back to 2009.
So is there anybody using 2018 or newer-- 2019, 2020? How about older than 2017? 2016? '15, '14? All right. What?
AUDIENCE: [INAUDIBLE]
LEE AMBROSIUS: So everything I'm going to talk about today will apply though for those that are on an older release. So we're going to use 2020 in the classroom today. That's what the latest version happens to be. That's what we're going to use. But just so you know that it will-- everything else will work though.
And you should be here wanting to learn how to customize AutoCAD. This class is kind of set up as a buffet-- a little bit of this, little bit of that, little bit of this, and what not happens to be. So we're going to talk about four different ways of customizing AutoCAD.
So it's going to be a condensed focus on these different areas. Wait until the end to ask questions, though. So my name is Lee Ambrosius. I do work for Autodesk. I am celebrating-- today is my actual official 12th year with Autodesk itself then. Prior to that I was an independent consultant for Autodesk in the areas of the help system. So user help itself, when you press F1.
My primary thing that I deal with these days is both technical writing for the API documentation as well as the customization documentation-- so AutoLISP, editing or customizing the AutoCAD UI, ObjectARX, VB .NET, all of that stuff I deal with the documentation for.
I've been customizing and programming in AutoCAD myself for over 20 years then. So obviously that predates my experience starting at Autodesk then as well. So just like you guys, at one point in time, I did come to AU and learn how to customize AutoCAD.
So it is a very long journey that I've been on to at least get to where I have been. Everybody's journey happens to be different based on what they happen to be doing. So in a nutshell, I document AutoCAD so you guys understand what it's doing. Hopefully you understand what it's doing then.
Today is a lab, of course, so we're going to get some hands on experience as far as customizing AutoCAD. We have three great professionals in the back. Two great professionals at least anyways. I don't know what Craig's doing back there. Chris Linder, Craig Black, and Scott Wilcox. For some reason I think I've been paired with them all week long. It seems like I think we're doing eight sessions together or something like that happens to be.
So if you get stuck, don't hesitate. Please raise your hand. We don't want you to walk away confused as far as customizing AutoCAD. There's nothing to be scared of. This is a very slow paced class, hopefully. We want to make sure that you feel successful once you leave here because customizing AutoCAD can add a lot of benefits to your workflows at work.
So please silence your phone. Get stuck, raise your hand. And hold all questions to the end. If I seem like I'm on track or ahead of schedule, I may interrupt to see if there's any questions. But for the most part, every year I do this class, it is a very tight session.
So as I kind of briefed or mentioned earlier, this path isn't the same for everybody, much like running-- 5K, 10K, half marathon, full marathon, whatever it happens to be. Maybe you don't run, and that's fine. But your path on those types of journeys is very different than everybody else that you may encounter as well.
So the person to your left, person to your right, is on the same exact journey that you are today. Talk to them, learn from them. How did they-- or what are they trying to get out of this type of class? What kind of problems might they be trying to solve? It might be exactly what you are trying to solve as well.
So as I may have hinted at, I'm a runner, or I like to pretend I like to run anyways. I have done what's known as the Dopey Challenge at Walt Disney World. It is four fun-filled days of running. 48.6 miles. So that is a 5K, 10K, half marathon, followed by a full marathon in four days. So it's a very dopey, ambitious task anyways.
And then most people do it once. I did it twice. I don't know what I was thinking about after the first time.
So what are we going to learn today? We're going to learn how to create and edit command aliases, we're going to create and run script files, define tools and tool palettes, as well as modify the QAT, the AutoCAD ribbon, and load those things with a workspace.
So the QAT happens to be that very small bar that happens to be at the very top part of AutoCAD. And obviously, chances are, if you're using 2012 or later, you've encountered the ribbon at some point in time. So customization can be programming, but we're not programming today. So there's nothing should be very sinister as far as this class goes. Everything that you know, already use in AutoCAD, you should be able to apply easily enough to today.
So as I mentioned, AutoCAD 2020. Doesn't matter if you know to use 2012, 2015, I'm not going to judge. But you should be on 2020. We're going to use Notepad. It's a very sophisticated programming tool or customization tool. And then we're going to use the CUI editor, the Customize User Interface editor, for AutoCAD. That's actually built into the product itself.
The foundation of this class is AutoCAD knowledge and your knowledge of commands and system variables. That's all I expect. You know what a command happens to be. Maybe you know the system variable it happens to be. You know how to start a command or interact with AutoCAD with a command.
So today we're going to focus on the handouts. There's two different PDFs that I uploaded as part of this class. There's the actual exercises which we're going to go through today, and you can basically take them right back to your office as well and repeat those as well.
So the PDFs are up online, as well as the data set and stuff like that as part of the course itself then. So everything that you're going to use today or be able to do today, you'll be able to take right back to your office and go through the same things as well and start working from there again.
So there is a supplemental PDF or handout as well. So basically a lot of the ramblings that I am going to do during class are nicely documented so you can go back and read through them as well.
So do you customize AutoCAD today? Some of you may be. Some you might think you don't what happens it might be. So what I'm going to ask is, what do you think customization happens to be as far as features inside of AutoCAD. It's kind of a weird question to ask because you're here to learn what customization happens to be.
So individual, personalize, easier, faster. Which features you might associate or think happen to be customization. So AutoLISP or user interface or hatches or blocks, whatever it happens to be. What do you feel it happens to be? So I'll give you a few seconds here or a few moments before I switch to the next slide. And then I'll tell you the way that Autodesk looks as far as features go. What happens to be customization.
This is kind of cool. Like I said, you guys are the Guinea pigs. So this is working out pretty good I think at the moment. Give you a few more moments here. Blocks. CUI. Automation. I like that faster is actually in the middle right now, and personalize is relatively up there as well.
WBLOCK. Palettes. Shortcut command. System variables. Type in commands. Those are all good examples of customization. Customization just doesn't happen inside of the product. It could be external. Most of the time we probably look at this and say, customization happens to be what's inside of the application, or in the case of blocks, part of the actual drawing itself.
So the way that I approach customization-- now, this isn't a hard, fast rule-- and the way that I've kind of organized some of the documentation over the years is that I look at it from three different sets. It's basic, it's intermediate, or it's advanced.
And inside of those groupings there's drawing-based customization-- so it might be layers, textiles, blocks, whatever you can save inside of your drawing. Application might be the user interface customization, scripts, stuff that you can use inside of other drawings. Now, blocks you can as well if you save them as a drawing file.
So basic customization. As I mentioned, layers, blocks, annotation, visual styles. Application might be a desktop icon to how you launch AutoCAD, tool palettes, workspaces, plot styles. Today we're going to take a look at command aliases, tool palettes, and workspaces under what I classify as basic.
Next we have drawing, which is dynamic blocks, which are a lot more complicated to set up and configure than a block happens to be. And then underneath the application side, action macros, scripts, custom line types, hatch patterns, shapes, and so forth. So today, out of that, we're going to take a look at scripts, user interface, customization with the CUI editor.
And then there's stuff that falls into the advanced category. The very complex stuff I guess I would say, or more complex than just simply just using lines or the Line command or the Circle command to do something with it. So we're not going to take a look at any of this stuff in this class today. Hopefully everybody can breathe easily now that we're not going to dive into anything remotely close to this category.
So before we get started, I want you to go on your desktop and open the data set folder itself. There should be a shortcut on the desktop for the data sets. We want to find the AS322572-L and make sure it's the basics and not the automate workflow.
Inside of that is going to be the class handout. Double-click on the class handout. And if you're prompted to associate the PDF with the Adobe Acrobat Reader, just make sure it's selected and click OK.
Once it's open what I would like you to do, so that we can run AutoCAD side by side later, I want you to click and drag the title bar. And you should drag it all the way to the right-hand side. Once it looks like it snaps to half the screen, release it then. So that way, we can have our handout and eventually our AutoCAD open side by side.
Everybody have that then? All right. If you can't find it, just make sure you raise your hand and the lab assistants will get you going.
Now that we have the handout open we want to do exercise E0 on page three. We need to let AutoCAD know where our custom files happen to exist for some of the things that we're going to create. So when we go to create a script file, we want to be able to insert a drawing as a block. So we need to tell AutoCAD exactly where that drawing happens to exist.
So if you haven't started to yet, launch AutoCAD.
AUDIENCE: AutoCAD or 3D?
LEE AMBROSIUS: AutoCAD, please. It will work but it will complicate things, at least to follow the steps in this class. So make sure you start AutoCAD then, not Civil 3D.
So then, once you have AutoCAD launched then, right-click in the drawing area. Click Options. You can go ahead and just do the steps as well, just kind of show them. Make sure that you're on the Files tab. Support file search path is selected. Click Add, and then click Browse. And we want to go to our local C, Data Sets, and then we want to find our AS322572-L basic customization.
Click OK. And then click OK to close out of the Options dialog box. Everybody have that, or at least most of you? And once you do, congratulations, you just customized AutoCAD and we're done for the day.
OK. I'll show it one more time, just for those that-- I did have AutoCAD started so I apologize for that. So if you don't have it set up, right-click, go to Options. Make sure-- Files tab. Support file search path is selected. Click Add, click Browse, and then Local Disk, Data Sets. And then it's the very first AutoCAD Customization Boot Camp one. Click OK, and then OK again.
All right. If you get stuck, just raise your hand. This is one of the most important parts of this class.
All right. How many people don't have it? How many people do have it? How many people aren't even listening to me at the moment? It's interesting that you raised your hand when you said you're not listening to me.
All right. We'll continue to work through it. So if you are stuck, raise your hand. There's no shame in it at all. I know there's different things that were thrown at you or I'm throwing at you that you might not be accustomed to.
So command aliases. What are they? How many people know what a command alias happens to be? Interesting. Not really, but. So a command alias happens to be a shortened name that's used to start a command. It can't be used to provide options or values. So it only can start just a command. And that command has to exist in your version of AutoCAD that's installed.
But command aliases typically are found across several releases and are unchanged. They're stored in a file called acad.pgp or acadlt.pgp. So if you're using a tool set, you should find it in acad.pgp as well because it's built on top of AutoCAD itself.
So an example of a command alias happens to be L. And when I type in L and press Enter, it starts the LINE command. C, press Enter, and it's going to-- unless somebody's changed it-- start the CIRCLE command.
So you don't have to go and look for certain commands on the ribbon if you know what the command alias happens to be-- starting LINE, A for ARC, E for ERASE is a lot more efficient than going to the ribbon, back into your drawing area because your cursor doesn't have to move when you're using a command alias. You just simply just start typing letters and you press Enter. Much more efficient than typing a full command name itself.
So for those that didn't know about command aliases, did you really not know about command aliases or just didn't hear the term before? So chances are most of you probably have used L for line rather than going to the ribbon. And if not, now you know a little bit more of an efficient way to start the LINE command, for instance.
So you can create your own command aliases. So instead of always accessing something that's on the ribbon or trying to remember the very long, complex command name, you can simply create a command alias for it.
So the syntax of a command alias happens to be the abbreviation. Whatever you want to type in at the command line itself. It could be one character, it could be two characters, it could be 16 characters. Whatever you want to call it, it's totally up to you.
And then with a comma, an asterisk, and then the command name that you want to start. So C comma asterisk CIRCLE. And if I go and load this command alias into AutoCAD by typing in C and press Enter, I'm going to get the CIRCLE command.
Chances are maybe you don't draw circles all the time. Maybe you want C to be copy. I seem to always copy stuff more than I create circles. That's just me though. L, as I said before, LINE. M for MOVE, E for ERASE, and so forth.
So you can actually open up the AutoCAD PGP file-- and we'll do that here shortly-- and you see actually the hundreds and hundreds of command aliases that are inside of there. And maybe there's a command that you use frequently and didn't know that it had a command alias, or maybe there is a command that you use frequently and want to add a command alias or change its alias. You can do that.
So to add or to modify a command alias, you simply just open up the PGP file, and AutoCAD allows us to do that. You make the edits to it. You save the PGP file, obviously. If we're going to make changes to it, we want to make sure that we save it. And then for AutoCAD to understand we made a change to the PGP file or to introduce a new command alias, we need to load it into AutoCAD using a command called REINIT, or we simply close AutoCAD and open it back up. AutoCAD will automatically open up the latest file that happens to be there.
So inside of AutoCAD then, on the Manage tab, there is a customization panel. We're going to do some stuff here today on the customization panel and then its neighboring panel for applications when we get working with scripts then.
So if we look at the customization panel, there's Edit Aliases. And then it offers a few different options. We're going to only talk about the one at the top today, the Edit Aliases itself. There's Edit Autocorrect, Synonyms list. Those are all PGP files. They do basically same thing. They just have slight different mechanisms behind them.
So the PGP file is a text file. As I kind of mentioned, you can open this up, browse it. You can print it if you really want to. I mean, there's nothing stopping you doing that.
So if I scroll through the list I start seeing 3A for 3D array. If I keeps scrolling down, eventually I will find the C for CIRCLE and E for ERASE. Maybe you do EXTRUDE a lot, whatever it happens to be.
And you notice that sometimes there's actually names in here that are not just a few characters long. I mean, like I said, there's hundreds and hundreds of command aliases in here. There's things like GENERATESECTION instead of a SECTIONPLANETOBLOCK.
A lot of times this happens because we've deprecated a command. And now, instead of just fully removing, you no longer know what that command happens to be. Autodesk sets up a command alias to point to the new command or the new functionality.
So typically, when we're inside of this file, we don't want to touch anything at the top. We want to make sure that we're going all the way down to the bottom. This is where the user defined command alias section happens to exist. This is the only place we should be touching it. And the reason behind that happens to be, if you start up AutoCAD with a previous version installed, you get command-- the Migration Wizard shows up.
Some have probably used it, some probably haven't used it. The Migration Wizard, it looks for things that are below this line. And it will automatically carry them from your previous version of AutoCAD into the current one that happens to be installed. So that way it becomes easier for you to migrate from one version of AutoCAD to the next version.
So if I enter something down below at the bottom-- that's what you guys will be doing here shortly as well. If I type in C-- and I saw before it happens to be-- it was CIRCLE. As I mentioned, I typically copy stuff more often. So if I go back to AutoCAD after I make my change to my PGP file, if I type in C, it still is CIRCLE.
What I need to do is I need to use that command REINIT-- N-I-T-- press Enter, and I want to say, yes, I would like to reinitialize my PGP file. Now if I type in C, it's now COPY.
So what I would like you to do now with your handouts that are still open-- should be-- go to page 5 and do the exercise that's there. So exercise 1, Define Custom Command Aliases then. So you're going to open the PGP file, add a few new command aliases to the PGP file, and reload it into AutoCAD or reinitialize it into AutoCAD.
[INTERPOSING VOICES]
AUDIENCE: The frame is ridiculous?
LEE AMBROSIUS: Is it slow today?
All right. Do you get it? If not, I didn't see enough hands going up. Unless you're trying to stretch, I guess. All righty.
So as I mentioned, you're basically leveraging the knowledge that you already have as far as dealing with commands though. You created a new command alias, and one that modified an existing command alias, that points to a different command. So simply the knowledge that you already have today. And we're just going to continue to build on that experience and that use of commands then as we talk about script files.
So what is a script file? Similar to the PGP file. It's just simply just a plain text or plain ASCII text file that happens to be. So it's human readable. There's nothing compiled or anything like that. So once you create a script file you can browse through it. Other people can browse through it as well if you want to.
And then it's used to execute a series of commands or system variables. And it executes in a linear order. So it's going to execute from the top all it to the bottom as long as what you're instructing AutoCAD to do, that it can be done. Now, if the script encounters an error, all bets are off if it's going to run correctly or what's going to happen.
And you can't execute commands that your installed version of AutoCAD doesn't understand. So you can't execute a Civil 3D command inside of AutoCAD unless you're running Civil 3D. It's just that plain simple. It's not magic.
You can't turn AutoCAD into Civil 3D or Architectural Desktop or AutoCAD Architecture these days or AutoCAD mechanical. The instance that you're running that script file in must know what that command happens to be. And if you do know AutoLISP or you're taking an AutoLISP class this week, you can put AutoLISP statements or expressions inside of a script file as well.
So why create a script or use scripts in general? They're a low learning curve. You already know how to use a command. Basically, it's the same information or input that you provide at the AutoCAD command line. You just put inside of a script file itself.
So I can put the line command in there, where I want the line to start from, where I want the next point to be, whether or not I want it to close, all sorts of different things. So it's the exact same input that you would provide at the AutoCAD command line itself.
So leveraging your existing understanding of commands and system variables. There is no special editor. Just like editing the PGP file with Notepad, we're going to use Notepad to create a script file as well.
It can execute many, many commands at a time. But what it isn't very good at is asking the user for input. It will not pause for user input. So it must know exactly all the parameters and the values in which a command needs to execute. So you can't pause to ask for a center point. That's not what a script happens to be for.
And as I kind of mentioned, they work across multiple releases and tool sets. So a script that executes inside of AutoCAD will execute it in Civil 3D because Civil 3D understands what the AutoCAD commands are. It just won't go the other way around though, unless you're just simply just using native commands.
So any script that executes in Civil 3D, as long as it's using the native commands and not something specific to Civil 3D, that script will run inside of AutoCAD or a different tool set as well.
And one caveat which most people don't worry about these days is executing stuff transparently, basically meaning that there's already a command running and you can execute a script to do something while that command happens to be already running. Not so much needed these days.
So as I mentioned, no input, no user input at the command line. Dialog boxes are a no-no. Your script will stop. Once it hits a dialog box, like the PLOT command, it will fail. It will just stop. It just can't go any further. So you would need to use the PLOT command line equivalent to what you'd use as a dialog box instead. So hyphen PLOT or whatever it happens to be.
So commands will execute. So for two system variables there's the FILEDIA and CMDDIA system variables. Those execute a zero no matter if they're currently set to 1 or not. 1 controls whether or not file navigation dialog boxes launch when you do something like an Open, Save, New, that type of stuff. You can set FILEDIA to 0, and it will prompt for that information at the command line instead of a dialog box itself.
CMDDIA is very similar. There are some commands-- very legacy and older commands-- that when set to 0, they'll display command line options instead of a dialog box. Most of those don't do that anymore, just simply because there is almost-- in a lot of cases, there is a 1 to 1 relationship.
And then starting with AutoCAD 2016-- so 2015 and earlier-- you can only execute one script at a time. With 2016 and later, you can actually have a script call another script call another script if you really want to. So you can chain them together. There is a different command you need to call, but you can call multiple scripts from a single script.
So as I mentioned, for the most part, scripts are whatever you want to type in-- whatever you can type in at the command line itself. So in this case, LIMITS, 0 comma 0, 1,056,816, ZOOM, the extent, GRIDDISPLAY, set it to 2. All stuff I can type it in at the command line itself. So I could have said, start the line command. Here's where I want my first point. Here's where I want a second point. And then just simply just end it, or insert a block as well.
So as far as a script goes-- so if you take a look at, as I said, all the input that's entered at the various different prompts, you can display them just like as if you would enter them at the command line, one after the other. So AutoCAD will say LIMITS, and then there's nothing after. It's a hard return so it goes, I'm going to press the Enter after I read this input. 0 comma 0, Enter. 1,056 comma 816, Enter, and so forth.
What you always want to make sure at the end of a script file is that there's a blank line though because you need to go from the 2, I need an enter, so there has to be a blank line at the end. Otherwise AutoCAD says, I have the 2. I'm going to wait for you to provide me some other input as well.
And if you want to you can put it all on top of one line. And then in this case, you would just simply separate everything by a space, just like you press the space bar to press Enter-- as an Enter instead of AutoCAD-- a space in a script in most cases-- in most cases-- will be accepted as an Enter as well. So it's whether or not how you want to set up your script file yourself.
So commands and options aren't case sensitive. So uppercase LINE, lowercase line means the exact same thing, just as if you typed in at the command line for LINE command. Text values are case sensitive. So if you're talking about something like I want to set a-- I want to provide the MTXT command or the TXT command with a specific text string, obviously I'd want sentence case or everything be in uppercase or whatever type of note that I want to create with my script file or populate an attribute field of a block. Those I would want to make sure that it's a specific case then.
As I already mentioned, spaces will act like an Enter, as if you hit the space bar. If you want a string or text value for something like the TEXT command, you must provide it in quotation marks. Now, there are some cases-- and you'll see that today as well when you create your script file dealing with a workspace system variable, it likes to accept spaces as part of the workspace name. So in that case, it's a hard return or a new line that triggers the Enter. So in that case, the space bar doesn't act like an Enter key then.
For those that may or may not support other offices in other countries-- how many people have offices in other countries? I'm just curious. Outside of the US. A few of you. OK.
So when you deal with setting up a script, what you want to do is actually put an underscore in front of the English or global name for the command and the options. That way will actually execute in the French version of AutoCAD or the Spanish version of AutoCAD using the English name. Otherwise, it will natively want whatever the command name happens to be in that language packet itself.
Another thing to be aware of is if you're inside of an environment that is customized in AutoCAD to the point that you're redefining command behavior-- so you can redefine inside of AutoCAD the SAVE command. You can tell AutoCAD that I want the SAVE command to be different than the outer box behavior. So maybe I want to do something and then save the drawing. You can completely change the behavior of AutoCAD if you really want to.
So our scripts, we want to make sure that there's a period in front of our command names, typically, to make sure that we're using the outer box or inbox behavior in that case, I guess, of a specific command. So if I want to make sure that I'm always using the [INAUDIBLE] version or the LINE command that Autodesk defines, I want to put a dot in front of it. For anything that we're doing today we don't need to worry about that though.
And then if you want to because it's kind of nice to go back six months later try to figure out what you were thinking about, you can actually add a comment inside of your script file as well. So anything that's after the semicolon to the right, AutoCAD will ignore. I would always tell you to put comments on a separate line. AutoCAD may or may not ignore it as expected.
So to run a script file you're going to either use the SCRIPT command, you can drag and drop it inside of AutoCAD, or you can use what's known as a command line switch, /b. And you can actually, during the start up of AutoCAD, run a specific script if you want to.
If you wanted to run a script across many drawings-- so maybe you wanted to fix CAD standards or whatever it happens to be or make sure that certain things are inside of all your drawings-- you can you use what's known as ScriptPro. That's a free utility on the Autodesk website that you can download and say, here's all the drawings. Here's the scripts that I want to run against all these drawings.
There are five primary commands that you need to worry about when dealing with scripts. The first two, DELAY and RESUME, not so much these days. So you might encounter it if you're talking about older script files of some sort. DELAY just simply just allows a script to run and then stop for a period of time.
Obviously on faster computers it's not that big of a deal, but on slower computers from a few decades ago, we would want to be able to opportunity to cancel a script at some point in time. So the pause would kind of allow us-- or the DELAY would allow us to hit the backspace key and then bail out of the script.
So the three that you really want to worry about today is RSCRIPT. Allows you to repeat a script. SCRIPT command. And then, as I mentioned before, you can actually run nested scripts then with AutoCAD 2016 and later. So you'd use SCRIPTCALL then in that case. I might have a script that calls SCRIPTCALL and allows it to execute additional scripts itself.
So very similar to our PGP file, except we would want to know exactly what we're doing. We would create or we would do our commands at the AutoCAD command prompt itself to find out-- because our script file has no clue what AutoCAD commands happen to be and options happen to be. So that's why I recommend doing stuff inside of AutoCAD so that you get all the values and input that your script is going to need.
So you'd want to expand the command line area so you can actually see what's going on. So if I just type in limits, just like my previous example, I can type in what my lower happens to be, what my upper needs to be. And then as you do it, you can actually see if you mistype something because obviously it's going to tell you, command doesn't exist, or whatever it happens to be.
Once you've kind of gone through the sequence of what you want in a script file, if you right, Cut, Highlight, and then say Copy, and then I can just simply just paste what I typed into AutoCAD. I missed one of them because I missed the LIMITS command itself in this case.
But if I copy what I've already entered into AutoCAD, I don't have to worry about something that I've mistyped though. And then I would just simply just remove any type of messages or prompts to get my script file, and then obviously press Enter at the end because I need that new line then to force a return.
So then, once that I've created my script file using my command history, in this case, I then can simply just create a new drawing or edit, work with an existing drawing that I want. And I can run my SCR file then, simply just using the SCRIPT command or dragging and dropping that script file, the SCR file, into AutoCAD itself.
So on page 6 then, I'd like you to go through these steps to create your own script file, and then save that file, and then load it into AutoCAD with the SCRIPT command.
How's everybody doing?
AUDIENCE: Looking?
LEE AMBROSIUS: Just looking.
AUDIENCE: Looking for title blocks?
LEE AMBROSIUS: Looking for title blocks. Looking for title blocks.
[INTERPOSING VOICES]
LEE AMBROSIUS: All right. It's getting noisy, so obviously people are getting done. All righty. Moving one. Tool palettes. Tool palettes are a collection of tools that can be used to start commands. Yay! Continuously, as I said, building on top of that command knowledge you already have with using AutoCAD.
It can be used to create new geometry. Insert and attach external files if you want to. So you could insert a title block. You could attach as an XREF a title block if that's what you do as well. But what's kind of nice about a tool palette is it actually allows you to assign specific properties to a tool.
So maybe I want, when I click on a dimension tool, to have a specific dimension layer set current. I could do that. So you can create new tool palettes and new tools based on content that's already existing inside of your drawings or outside of your drawings in the case of a file.
You can group tool palettes together. So maybe you wanted to create tool palettes that are specific to your company or specific to a discipline or an area division inside of your company. You can do that as well so that only those tool palettes are seen by those individuals inside of your company.
You can share tool palettes as well with other people. So they're just not things that you can create and they're only stuck on your machine, you can actually create them on a network drive if you want to and point to that location for the instance of AutoCAD. So these can be shared with by other individuals. So you can create, as I kind of mentioned, tool palettes that are specific to your company or maybe even a client or maybe even specific to a project.
They're designed to be very simple and quick to set up. So maybe you're working on a set of drawings that use specific blocks for architecture, for doors, or whatever it happens to be. You can simply just grab the block that's inside of your drawing, drag it on top of the tool palette, and it's going to create a tool based on that geometry and all of its properties that are already assigned to it.
So tools can be created from, as I just mentioned, geometry, annotation inside of a drawing-- so dimension, text, a table. Anything that pretty much you can create in a drawing can become a tool. You can add commands from the CUI editor. So we'll go into that in a little bit. So you can actually add commands that are actually defined on the ribbon or someplace else into a tool palette.
And what's nice is that when you go to click that button, as I kind of mentioned, you can actually say, I want this layer to be set current before this tool is actually executed. So you can enforce CAD standards a little bit more as well.
You can create hatch patterns and blocks from the design center. You can add external files, as I mentioned, from Windows or File Explorer. So you can just simply just drag and drop DWG files, images, DGN files. Whatever you can attach inside of your AutoCAD drawing can become a tool then.
And then for those that might be dealing with rendering instead of AutoCAD-- I know it's the best thing to do, right-- you can add visual styles, lights, and materials and so forth as well to a tool palette.
So once you add your tool palette, you can edit its properties by right clicking on a tool then and specifying properties that are specific to that tool or very general properties, like a layer, a color, line type. And then you can organize your tools into different things. So if you look at the standard AutoCAD ones, there's text in there. It kind of says, these are ANSI hatches. These are ISO hatches. So you can add a little bit of descriptive text to your tool palette as well.
So it functions like any other button or any other palette inside of AutoCAD. There's a Close button. Text tool. The tool. Primarily you're going to be just-- a tool is simply just anything that might create geometry, annotation, and so forth then.
So creating a new tool palette, you simply just bring up the existing tool palette's window itself with the TOOLPALETTES command or the TP alias. It's kind of funny, TP. But OK.
But once you have that up, you can right-click on an existing tool palette itself and say, New Tool Palette. This will give you a completely blank slate to create new tools that are specific to you. And then you simply just decide what you want to add to that tool palette from your existing drawing then. So you might open up a drawing, as I mentioned, that contains blocks and other information and simply just start dragging and dropping to that specific tool palette itself.
So if I switch over to my AutoCAD here, if I open my sample file from the data set, go to my View tab, here's my tool palettes. So these are the default ones that AutoCAD comes with. It shows examples of dynamic blocks, hatches, and so forth. If I right-click, I can say, New Tool Palette. And then I can call this whatever I want to call it.
Let's see. Options. Make this a little bit easier to see. So if I select the Hatch, if I right-click and drag, I can create a new hatch tool. I can do the exact same thing with the dimension as well. Just drag and drop.
Now, if I use this tool, it's going to allow me to apply the exact same hatch. Now, just like in most other commands inside of AutoCAD, if I press space bar, it will allow me to continue to use this tool over and over again.
If I right-click on the tool, I can go to Properties. Here's all my hatch settings. Here's my particular layer that this is going to be inserted on each time. Now, as I mentioned, these things will allow you to go between drawing. So if I create a rectangle and I use my Hatch tool, notice if I place it it has all the same exact properties that it did when I originally created it.
So the hatch was actually created on the hatch layer even though the hatch layer didn't exist in my default drawing. So the same thing can be done for with blocks as well. I can say that I always want a block-- my title block, for instance-- to always be on the title block layer when I use it from the tool palette.
OK. What I would like you to do is turn to page 9 then of your handout and do the exercise on tool palettes.
[INTERPOSING VOICES]
LEE AMBROSIUS: All right. How's everybody doing? Almost there? I'll give you just a little bit more before I move on. As I said, this class usually runs pretty tight in time.
[INTERPOSING VOICES]
LEE AMBROSIUS: All righty. We'll get moving along. Quick Access Toolbar.
[INTERPOSING VOICES]
LEE AMBROSIUS: Shh. I'd do the clapping thing like my wife does with the younger kids, but I can never get it right. All right. So Quick Access Toolbar. So as I mentioned, it's the little bar at the very top of AutoCAD, and it's dealing with file management related tools-- creating a drawing, opening a drawing, saving a drawing, plotting a drawing. It's primarily what its focus happens to be. Tools that aren't specific to any one what we classify as tasks inside of a drawing.
So it provides access to common tools across all ribbon tabs. It's located by default in the upper left-hand corner. And what's interesting is that you can actually have multiple QATs created, but you can only display one at a time.
So maybe you want to create one that's specific to your Civil tools versus your Architectural tools, whatever it happens to be. You can use a workspace to display a Quick Access Toolbar. And that's how we would be able to define multiple ones but only be able to display one.
So to customize it there's several different ways of doing it. You can actually click on-- there's like a little down arrow in the upper right-hand corner that will bring up a menu and allow you to toggle or turn on and off certain predefined commands. So maybe you don't want to Plot on there. Maybe you want Publish. You can put that on there if you want to. Maybe you don't want New on there. Maybe you just want to Open and Save, whatever it happens to be.
Or you can right-click on the QAT and, say, customize commands or customize in the CUI Editor itself. Or you can go the more traditional or longer route and use the CUI editor, which gives you the most flexibility as far as which commands or tools can be up there itself.
So for what we're going to do today, we're going to actually take a look at using the CUI Editor itself. So in the interest of time, I'm going to take a little bit longer here, and I want you to kind of follow along. We're going to kind of do the steps, but we're not going to exactly do the steps, if that makes any-- or the exercises itself. Because we're down to roughly 22 minutes, and I want to make sure that there's some time for answering questions.
So inside of AutoCAD, across the top, click on the Manage tab. So I'd like you to follow along right now, or just listen. It's your choice. There's the User Interface option. Click on User Interface. This dialog box, you're going to have a love/hate relationship with it for a little bit of time. I'm sorry. That's just the way it's designed.
Once you open it, workspaces is going to be expanded by default. We're not going to touch workspaces at the moment. I want you to look at-- find the second node down, Quick Access Toolbars. Right-click and say New Quick Access Toolbar. And then provide a name if you want to. If it allows you to type a name-- my QAT-- enter a new name. If it doesn't, right-click and say Rename.
When I click on the node then for My QAT or whatever you happen to call it, it's going to give me a default set of commands itself. So Autodesk has decided that New, Open, Save, Undo, Redo, and Plot is what you're going to always want to do. I tend to like doing other stuff, but I'm not a traditional drafter anymore anyways.
So if I come down to the Command list there's a Search for a Command text box. If I click in there I can type in-- in this case, I'm just going to type in spell-- S-P-E-L-L. And then I want to select the Spellcheck command and go up to My QAT.
So I see a little blue kind of horizontal line. I'm going to drop it between Redo and Plot. And then I'm going to do the same thing with Publish. So I'm going to type in publish in the Command List text box. Find the Publish command and drag and drop it right below Spellcheck itself.
I'm going to click on the dropdown list-- the All Commands Only dropdown list-- and choose Ribbon Control Elements. If you have Publish, which chances are it's still in the search field, type in layer-- L-A-Y-E-R.
What I want to find is-- should be close to the bottom-- Layer List Combo box. I'm going to select and drag that up towards the top-- up towards My QAT as well. So after Publish. And drop it. So I've added Spellcheck, Publish, and the Layer List Combo box.
What I want to do is-- I don't Plot, so I'm going to highlight Plot, and I'm going to right-click and say Remove. And I'm going to watch the box do something really funny here. Great. Yes. So click Yes to remove it.
Click Apply to save the changes. Don't click OK. And then I'm going to go up to my Workspaces node now. I want you to right-click on the one that says Drafting Annotation Default Current. And I want to say, Duplicate. We're just going to duplicate it right now.
So then it's going to give me a copy of whatever it happens to be. Right-click on it and say Rename. My Workspace, because I'm really original when it comes to naming this stuff.
Once you've created your new workspace and you want to actually be able to use it or to see what it's set up to, you want to right-click on it and say Set Current. Now, you're not going to see immediate changes because we haven't clicked Apply yet. Click Apply. And then you're going to see AutoCAD flicker and do something else.
Now, since we haven't done really anything to the AutoCAD user interface yet-- we've only created a QAT in a workspace that's based off of the drafting annotation one, which was the previous current one. In the upper right-hand corner is Workspace Content, Customize Workspace. I'm going to click on Customize Workspace.
And now this allows me to decide that I want my Quick Access Toolbar to be displayed when this workspace happens to be set current. So this is the same thing you're going to do when you're talking about creating or customizing a ribbon tab or a panel. You need to make sure that it's assigned to a workspace so that it can be displayed.
So once underneath the Quick Access Toolbars your specific Quick Access Toolbar's checked, once that I click Apply, notice that I should see something has changed up in the upper left-hand corner. In this case, I'm seeing Spellcheck. I'm going to click OK to close out of the dialog box.
Now if I expand AutoCAD I can now see my Spellcheck, my Publish, and my Layers dropdown list. So no matter which tab I'm on I now have my Layers dropdown list.
Now, Autodesk kind of stole the idea from me a number of years ago. You can now click on the little dropdown list itself and just automatically add layer, and it adds the Layer dropdown list to it. They ruined my cool tip from my class.
But now you can actually-- as you switch layers, you can see which-- once you switch ribbon tabs anyways, you can actually see which layer is current. You don't have to go back to the Home tab again to see it or to set one current if that's what you don't want to do
Yes/no/makes sense? Kind of cool? Yes, very cool. All righty. So we'll skip. As I kind of mentioned, we just kind of walked through creating a QAT. Anyways, that's kind of what the exercise did as well, pretty much word for word.
So the ribbon then. The ribbon is broken up into tabs then, and each tab can have its own panels. And then each panel can be divided into two parts. There's one part that's open or expanded by default, and then one that you need to click on the little down arrow or title bar to actually see additional tools.
So Autodesk displays the most common tools above, and then additional tools that most people don't even know that exist because they kind of skip right past them, which is always interesting. Below the Autohide line itself.
So the toolbar is set up by tasks then. So I'm going to annotate. I'm going to insert. I'm going to output. That is the logic of how the ribbon is set up. Now, that logic might make sense for us. Might not make sense for your company. You can go through and rearrange the ribbon all you want with what I'm going to show you.
You can add additional tools if you have tools that are already inside your company. That might be a LISP routine or a script file. You could create a button that launches a script file if you create one from that perspective. So it's always displayed below the Quick Access Toolbar though. It's a big joined bar across the top.
You can customize the ribbon directly inside of AutoCAD itself. So there are some things that you can do. You can display or hide ribbon tabs that are actually already available. So if I look at my AutoCAD, if I right-click on a tab, I can say Show Tabs. And these are the tabs that are available.
Not every tab is displayed by default. The same thing with panels. There are certain tabs that have certain panels that are disabled. Maybe I don't use parametric for my drawings. Why not just turn the tab off? You can easily enough do that. So that's one way of customizing it inside of AutoCAD itself.
Now, another way is that I can actually go to something like the Annotate tab and drag and reorder the Ribbon tab itself. Maybe I dimension more than I create text. Maybe I don't want to see leaders or tables or markup, whatever it happens to be. I can say, I don't use this stuff, so why should I see it?
It's to basically improve your workflow. The less tools that are on the screen, the easier it is to find what you're looking for. Or maybe, like I said before, there's simply just other ways that you want it to work. You can display things like the Layers dropdown list.
Maybe I want the Properties itself. Now if I drag it off the ribbon-- it's kind of interesting-- it sits there and hangs up by itself. So I can have ribbon panels that are floating inside of AutoCAD. I don't have to have them in a specific spot.
Maybe I have a second monitor and I want to dock certain things. I don't know what just happened there. Ooh. I'll probably just run into something that I'm going to have to explain myself out of it in a little bit. But you can rip stuff off a Ribbon tab if you want to though and make it available for multiple different things.
So we're at 2:20. Let's make sure-- talked about workspaces. You can use workspaces to display the QAT, as I showed. Workspaces are used to add Ribbon tabs, palettes, whatever it happens to be. Visual elements inside of AutoCAD. So I can shuffle things around and create multiple different workspaces based on the tools and the type of tasks or the types of projects that I'm working on.
As I demonstrated, you can pull stuff off of the ribbon and reorder it if you want to. Once you do that, you can actually save the workspace as well from AutoCAD using the WSSAVE command. Will you allow you to save any changes that you've made to the workspace outside of the CUI Editor.
So I'll skip this. And OK. So I will give some time to ask questions. If you don't have any questions, you're more than welcome to continue along with the exercise on the ribbon part of the exercises and the workspace one then. And if there is no questions, then you continue to do what you want to do for the remainder 10 minutes. Question, yes.
AUDIENCE: What's the safest way to disable a command [INAUDIBLE]?
LEE AMBROSIUS: So the question is, what is the best way to disable a command essentially? You can use the UNDEFINE command and add it to a script, or often it's added like an AutoLISP file. And then that's loaded. So you undefine the LINE command. And then when you type in LINE or you try to click it from the ribbon, it's going to say unknown command.
Now, I mentioned before that dot, if the user is smart enough, they will put dot in front of the command and still use the command. So there isn't exactly a 100% way unless you're going through with something like ObjectARX or something like that and really brute forcing and overriding a command, which some of the tool sets overwrite the behavior of the FILLET command or TRIM command when it comes to AutoCAD architecture. They inject their own TRIM or FILLET behavior over top of the AutoCAD ones.
So the UNDEFINE command is the easiest way of going about it, but it is not a bulletproof way of stopping a user from doing it. Education, honestly, goes a long way. I mean, it really does. I mean--
AUDIENCE: Even the old school guy that [INAUDIBLE] shouldn't do.
LEE AMBROSIUS: Yes. There's the old school guys that will do things that you will tell them not to do and they'll continue to do it. But that's the only way of doing it, through the UNDEFINE and REDEFINE commands. Yes.
AUDIENCE: Can you put an action macro in a tool palette? Because when I drag the button on the toolbar, [INAUDIBLE]
LEE AMBROSIUS: So the question is, can I add a action macro? I don't know if anybody knows what action macros happen to be. Action macros are a way to record commands using-- there's a tab or a panel on the Manage tab called the Action Recorder. You can do some stuff in AutoCAD-- start record, do some stuff in AutoCAD, and basically create a command that will play back those exact same behavior or that step anyways.
So the question was, can I playback an action macro on a tool palette? Yes. In the case that you'd want to do, you'd want to create the command using the CUI Editor. So the command string in that case which you would be executing would be the macro name. And then you would drag that or add that tool, just like we added the revision cloud command to your tool palette, and then it will have a macro string to it.
So then if you want to override the layers or whatever it happens-- the current layer before that action macro is played, you can then use the behavior of the tool palette itself. So yes. So if you had a script and you wanted to add it to a tool palette, you would use the CUI Editor, create a new command-- so there's a new command option in there. It's explained inside of the steps as well.
In that case, I'm creating a Revision Number command and adding it to the ribbon. But once it's created, I can then add that to a tool palette as well and have all the same tool palette behaviors available to that, just like one of my other commands. Or I added the Revision Cloud command, and then I was able to set the REVCLOUD layer to that tool.
AUDIENCE: [INAUDIBLE]
LEE AMBROSIUS: Yeah. So it's not a direct type in. So you can't directly create a command tool inside of a tool palette. You have to use the CUI Editor. And then you can add it. But once you add it to a tool palette, the CUI Editor command, the tool palette one is only a copy. It's not a redirect. So it's its own thing. So it would become two separate things, so you'd have to edit in both places. But you could edit the string directly in the tool palette though.
Any other questions? Question here.
AUDIENCE: Say you're using Civil 3D subassemblies but you want to make your own assembly, can you build an assembly and then add that to the tool palette you're using after and it'll [INAUDIBLE]? Or is that--
LEE AMBROSIUS: So the question is, if I'm using Civil 3D and I want to create a tool palette with subassemblies in it--
AUDIENCE: Yeah. [INAUDIBLE]
LEE AMBROSIUS: I will plead ignorant and say I only know what happens in AutoCAD. So you can try it and see what happens. Each one of the verticals do-- so each one of the verticals do implement their drag and drop in what they support in a tool palette differently. Now, just like a script, that tool palette will not obviously function correctly inside of AutoCAD because the backend understanding, AutoCAD is going to be like, I don't know what the subassembly happens to be.
So yeah. I figured as much as you could, but I don't have a 100% answer. So there's your answer. So yeah, you could then.
AUDIENCE: You could do subassemblies and assemblies both. So you can do subassemblies, or you can grab a whole assembly and drag it over, which includes--
LEE AMBROSIUS: So the response was, can I do through palettes and add subassemblies from Civil 3D? The answer is yes, according to several people up here. Not me. Several people. So if you want their numbers, go and talk to them when it goes rogue and broken.
AUDIENCE: I tried to add a PLOT command to the tool palette on a specific plot style. If I have a predefined PDF, [INAUDIBLE]. Not just plot. I want to be able to plot to that plot style and have that on the tool palette.
LEE AMBROSIUS: The question is, I wanted to have PLOT behave basically a specific way, a specific set of options, and add it to the tool palette then. You would basically create a new-- so open up the CUI Editor. And in that Commands pane section, you would create New Command. And then you would specify all the options that would go with that.
So you could do it. It's just going to be, you need to provide input for all of those types of things. But that's what you would do. And then, once it's created, you would add it to the tool palette then.
AUDIENCE: That would be a nice script file, by the way.
LEE AMBROSIUS: Ooh, yeah. You could use the script file. And then you just simply just use the CUI Editor to say, here's the-- execute this script or whatever. Script name, or SCRIPT command and the script name, and then add that as well.
So thank you. If there's any other questions-- I think we're close or almost out of time, basically. So I appreciate your time for today.
[APPLAUSE]