We will look at the difference between a Script and a Macro and discuss the possibilities of both. Familiar menu, menu items, tools, icons, command line.In this post we will look at another automation tool – the command Macro. If you are an AutoCAD LT user, DoubleCAD XT will immediately feel familiar.AutoCAD scripts can be stored in a central location on your server. AutoCAD ScriptsThe Good – AutoCAD scripts can contain long lists of instructions for AutoCAD to follow. All you really need to automate AutoCAD is a good understanding of the sequence of commands that you need to complete to get the job done. A Macro usually lives within your CUI or on a Tool palette.I hope to demonstrate that the process of writing a Macro is the same as that of writing a Script. An AutoCAD command Macro is also a list of instructions for AutoCAD to follow, but a Macro is run from the AutoCAD UI (A tool bar button, menu pull down or short cut key combination). SCR, that contains a number of instructions for AutoCAD to perform at the command line.
![]() Autocad Lt Hatch Tool Palette How To Run YourPrevious releases may be a little different. Right click over any blank area on your palette and chose ‘New Palette’ to create a new blank palette which we will use for testing our macro.Tip: These instructions are for AutoCAD 2012. Running and Debugging your Macro.You can run your Macro from the AutoCAD CUI (See Edwin’s post on creating new AutoCAD commands) however I am going to show you how to run your command from a tool palette.First use the keyboard combination shortcut CTRL+3 to open your tool palettes.![]() ![]() I hope that it works for you first time. You can now paste your Macro in under ‘Command string’.Click on the OK button to close the dialogue and save your Macro.Finally, click on your new button… and see what happens!You now have all the fun of debugging your Macro. Drag and drop the run script command from the customize user interface dialogue onto your palette.You don’t have to use the run script command for testing Macro’s, but there isn’t a ‘Run Macro’ command, so it will have to do!To add your command Macro to the new toolbar button, right click on the ‘Run script’ tool palette button, and chose ‘Properties’. Type ‘script’ into the search box to bring up the run script command. This will bring up the ‘Customize user interface’ dialogue. Right click over any blank area on your new palette and choose ‘Customize commands’. Calendar creation software for macYou could create a Macro to plot your drawings at the click of a button, update your title block or create geometry on your company standard layers. You can create simple quick Macro’s that will save you time and effort every time you have to create a drawing. Macro examplesHere are some examples of command Macros that you could use, see if you can work out the commands and options used.Start the fillet command with a radius of zero – Handy for joining reluctant polylines.Join multiple lines or arcs into a polyline in one go (this Macro assumes that the variable ‘PEDITACCEPT’ is set to a line at the point you click and then rotate your selectionPurges all registered applications from memory.Erase everything! – be careful with this one :D What will you write a Macro for?Writing Macro’s for AutoCAD can be simple and fun.
0 Comments
Leave a Reply. |
AuthorJill ArchivesCategories |