• Blog posts


    By Dennis Collin


    Recently I posted about how a custom macro could be applied to the Single and Multi-Line text commands on a tool palette to enable text elements to default to centre justification. This post can be found here. However, since many AutoCAD users use the commands on the ribbon, it is useful to apply this custom macro to the text commands located there instead.  The principle is very similar to the palette environment, but customising the ribbon is be achieved by editing the Acad.CUI file. It is prudent therefore to take a copy of the file and back it up so that if the customisation process goes wrong, AutoCAD can be set back to its basic settings along with any custom tabs that might have existed previously. This process does require some patience and perseverance and care should be taken with the customisation process. Read this post thoroughly before customising the menu and if necessary consult my other posts on custom macros and well as AutoCAD’s extensive Help files.


    This CUI file contains all the information for AutoCAD’s Ribbon layouts, right click menus and mouse behaviours. CUI stands for custom user interface. The file itself is situated within AutoCAD’s support folder typically found under X:\Users\USERNAME\AppData\Roaming\Autodesk\AutoCAD 2022\R24.1\enu\Support

    Once located, a copy can be take of the CUI file. Then execute AutoCAD and Type CUI at the command prompt.

    A large dialogue should appear with several panels apparent. NB. some users may need to expand the dialogue box via the chevron button in the bottom right hand corner of the screen.

    Under the Customisations in All files section, browse and locate the Home 2D Annotation section, (1) within this section will be the panel and row descriptors for the 2 text commands, Mtext and Dtext.


    From the command list in the bottom left section (3), locate the respective commands and drag a copy up to the top left panel. In this example Single Line Text (Dtext) and Multi Line Text (Mtext).

    Once copied rename the new commands as Centred Justified Mtext or Single Line Text or similar. Tool tips can also be added if desired.

    Under the Macro Section (4) add the following switch for:

    Multi Line text:


    Single Line Text:


    Once complete, the section should read like the image below.


    Once complete click ‘Apply’ and ‘Close’. This should refresh the ribbon and the new custom commands should appear in the appropriate section.


    Test the ‘new’ commands and check that the macro works with the correct settings applied; in this case a default centre justification rather than the more usual top left alignment.

    If the process does not work, worst case scenario, restore the backup CUI file and try again, although depending upon the error message on the command prompt it could be something just as simple as a misplaced comma on the command string!

    If it does work, well done! Other commands could be added to the Ribbon, try moving or copying some commands to more prominent tabs as desired, but remember, before editing the CUI file, always take a backup of the last working menu. It is quite easy to make a mistake and break the AutoCAD menu which is why this process should only be attempted by expert users.

    Wherever they are used command macros are useful in getting AutoCAD to perform in a way best suited to bespoke scenarios and save users having to spend extra time editing elements to get them to display or perform as required.

    Good luck!



Please sign in to leave a comment.