Installing a Custom AutoCAD Toolbar (CUI interface) I used 2008LT for this tutorial; you may have a later AutoCAD with a different appearance. However, the customize user interface (cui) should be similar. Before you start you need both AxciScape and AutoCAD open. AxciScape produces AutoCAD script files which must be Run within AutoCAD. You can do this by typing SCRIPT into the command line and then select the file from the file list. AxciScape by default creates the script file in its Work space folder, normally found in My documents. And also by default the script is given a standard filename autocad_script.scr. If you retain the default settings then a custom toolbar can be installed into AutoCAD to load up the default script filename and run it with just 1 mouse click. This can be a real time saver if you, like me, prefer to do several plots in a short space of time (using Undo within AutoCAD each time); I can then tailor my drawing functions before finalizing the job. To create such a toolbar, first open AutoCAD and type CUI into the command line. Now find the toolbars entry in the main list and right click, select New Toolbar (see below).
Now give the new toolbar a name, I am calling this one AxciScape (see below). The named toolbar appears in the toolbar list (see below). At this stage it doesn't have any buttons, so that's the next step. Click the star icon (see smaller red circle below) to create a new command.
A new command button appears. Pick any image you like to represent the command and then give your button a name; again anything you like. I have called mine RunAxci and have selected an icon. Note how the command button entry has update in the lower left list.
Now go to AxciScape and click on the I/O icon top left. Select the Export tab and click on Export to CAD. Make sure you are looking at the Export Script tab and click on the Set Default button (below). Then select the text, right click the mouse to copy. The essential text to enter is the actual Macro. A Macro is simply a sequence of commands pushed together. They don t make much sense to read! Click the mouse in the Macro textbox where the text below has ^C^C. A small button appears (see red circle below); click this.
A small text window appears containing ^C^C (providing this text was in the macro button). Now it gets a bit fiddly. We need to enter the text that we copied from AxciScape BUT we must also change it slightly AND add some additional text to the start and end. The following text must go at the start of the text from AxciScape. ^C^C-osnap;none;script;" And the following text must go at the end of the text from AxciScape. "; Finally you must change every \ character into a / character as AutoCAD needs them this way! So for my own installation my Macro text would end up looking like the following (note the correct / characters). ^C^C-osnap;none;script;"C:/Users/cps2/Documents/AxciScape_Work_Space/CAD_Export/autocad_script.scr";
How you go about putting the text together is up to you; I used Notepad but you could carefully copy/paste directly into the Macro text box. The inclusion of every letter is essential; some of the punctuation characters have special meaning to the Macro and control the processing. Don t be tempted to add spaces or delete what you may think is a space; or it will fail to work! There must be no spaces or tabs at the start. My text looks like the above. The line break after the is just AutoCAD arranging the text. Once you have entered your text Click Ok to return to the CUI window.
I must now place the button into my Toolbar by first clicking the mouse over the button text in the lower left window and dragging it up to my toolbar until a small blue arrow appears; releasing the mouse here drops it into the toolbar (see below). Check that the button is visible below the toolbar (see left image) and Click OK on the CUI main button so it closes. Upon returning to AutoCAD your new Toolbar may or may not appear on the screen depending on what version you are using. You may have to enable it and dock it.