Polyline doesn’t plot its lineweight

Today a colleague of mine could not plot a polyline at the desired lineweight. We tried different layer with the colour changed to see if was the plot style interferring. Tried turning off scale lineweights. Tried overriding the lineweight on the object itself.  Tried a new plot style.

After all these attempts it occured to me that the polyline thickness might have a impact on the lineweights and it does.

Altering the polyline global width to 0 meant the lineweight now plotted correctly.

Nested XREFs and layer states

If you use a system of drawing sheet and drawing model in your practice where both are seperate files and the sheets are like a piece of paper with the drawing information pulled into it then this is something you might have come across already, if not then this might help you in the future if you encounter it.

So generally you will attach one or two external drawings to a sheet file and then adjust layers to suit in the sheet file. However occaisonally you will set up a drawing with an XREF, usually an overlay type of drawing (not to be confused with overlay type of XREF) where you have a base drawing and the layers are adjusted to be simplistic and then further information is drawn over the top, e.g. a fire drawing or drainage drawing.


This is where it gets complicated. There is now a chain of drawings. Drawing A (the base drawing) –> Drawing B (the overlay type of drawing) –> Drawing C (the plot drawing). [Note: the arrows indicate XREF attachements]. This chain of XREFs is called nesting.

The problem comes when you want Drawing C to look the same as drawing B does. When you attach Drawing B to C all the layers on drawing A change to when they were first attached to drawing B, all the changes in drawing B seem to be lost. But when you go back to drawing B it still looks as it should. Confused?

The problem is AutoCAD pulls in XREFs (external references) from their source files and not through the nesting. So any information for drawing A setup in drawing B will not be imported into C as drawing C as the information is directly pulled from drawing A.


In order to circumvent this annoying behaviour layer states export and load should be used. Or you just reset them up if its only a few changes, but if lots of colour changes and layer adjustments have been made then this is the method for you.

This is taken from this page: (Copyright AutoDesk).

To export layer settings

  1. At the command prompt, enter LAYER.
  2. In the Layer Properties Manager, click Layer States Manager.
  3. In the Layer States Manager, create a new layer state or select an existing one. Click Export.
  4. In the Export Layer State dialog box, enter a file name and specify a location for the file.
  5. Click Save.
  6. Click OK to close each dialog box.

To restore layer settings

  1. At the command prompt, enter Layer on the command line.
  2. In the Layer Properties Manager, click Layer States Manager.
  3. In the Layer States Manager, select a named layer state.
  4. Select the settings that you want to restore.
  5. Click Restore.
  6. Click OK

Now you should have the correct layer information in drawing C!

Grip edits not working

Introduced quite a while back for polylines and a while back for hatch, these allow you to add, edit and stretch existing lines by editing the blue square grips.


However sometimes on polylines the edit menu for removing does not appear. This is usually due to two overlapping grips being present in the same space.


To solve this problem, move the grip between the two points that don’t work to reveal the hidden overlapping grips. Now you should be able edit the grips again.


Imperial dimension – metric drawing

One of my colleagues noted that she wanted all her measurements to be in imperial when dimensioning for her client. The drawing had been drawn in metric mm.

Whilst there are ways to convert the drawing in its entirety into imperial and visa versa, there is very little information on temporarily change the units or dimension style.

So here is how to place an imperial dimension on a metric drawing.

First go to the dimension style manager (_DIMSTYLE) and then select your dimension that you will be starting with. In our office we have a dimension style for each scale the drawing will be printed at (we have not got to annotative objects yet…). So I started with 1:100.

Metric Dimstyle, Primary Units tab
Metric Dimstyle, Primary Units tab

Click on new and it will create a new style based on the 1:100 dimension style selected. I renamed the new style to 1:100 feet so its clear that it is a different style but has the scale of 1:100 and is in feet!

Then leave every other setting alone and go to the Primary Units section. Change the unit format to Architectural and the Precision to 0′-0″.

Then change the scale factor to 0.0393700787. This scales the mm in inches. It is the basically the conversion of 1mm to 1inch.

Imperial Dimension (for metric drawing), Primary Units tab
Imperial Dimension (for metric drawing), Primary Units tab

Save style and that’s it. You now have a dimension style that outputs feet and inches from a metric drawing. Even better you can have both metric dimensions and imperial on the same drawing with this method.

Hollow Dimensions

My colleague asks me today, “why are my dimensions hollow and not filled?” I thought, maybe FILLMODE is not set. But that was OK.

It turns out that this can be caused by non-flat or “elevated” drawings. I.e. 2D drawings that extend into 3D space. Usually caused by UCS not being rotated properly and it being skewed into 3D space.

The solution is to change the UCS in the modelspace or paperspace viewport so it is flat and things should be back to normal!

MTEXT Slow to Start

If you have decided to place all AutoCAD items in a central location and link each machine across the network to those locations by adding them to the “Support File Search Path” then this is for you!

I was experiencing really slow mtext editing, slow loading of options dialog and slow loading of the hatch editor. I did some digging and found very few solutions. Only one that caught my eye where the response was “Maybe that’s part of the problem. ” I thought, lets test that. I removed the network paths from the support path and voila! Everything is blisteringly fast again.

Next step, work out why the network bit is slow!

Macros – More Advanced

In my next post on customisation I will be looking at more advanced macro writing. After this post there will be a few individual macro examples which should be helpful!

Please refer to my macro basics and other customisation tutorials first.

In this tutorial I am going to refer to two UCS commands I have written to get around the lack of easy plan rotation in AutoCAD LT. In full AutoCAD you get a rotation box in the upper right corner that looks like the one below. This is unfortunately not available in LT.

Rotate from Viewcube
Rotate from Viewcube

These are a bit more automated version of the tutorial I have posted before as I decided that even that was too much effort!


The first macro rotates the UCS back to world and takes the plan view with it. This avoids the need for UCS follow being set to 1 and the annoying zoom extents bug it has.


So lets break down the macro above. Its just a simple chain of commands to do with the UCS and PLAN.

  • The first ^C^C at the beginning is escape twice to ensure that the command line is clear
  • Then the UCS command is started
  • Then the UCS command is told to reset to (W)orld
  • Then the PLAN command is started
  • Then the PLAN command is told to reset to (W)orld

Now the drawing is viewed in world view and the UCS is orientated the same way.


The second macro rotates the UCS to an object and then updates the view to suit.

^C^Cucs;ob \plan;c;

So lets break this one down as it has something slightly different in its layout.

  • The first ^C^C at the beginning is escape twice to ensure that the command line is clear
  • Then the UCS command is started
  • Then the UCS command is told to select by object
  • Then the script waits for input by the use of a space then a backslash
  • Then the PLAN command is started (after input)
  • Then the PLAN command is told to update to the (C)urrent


This formula can be used to make further buttons to emulate the plan rotate found in full AutoCAD or make any chain of commands work.

A quick way to create a macro is to run a command and follow the command line and write down your inputs and once you have completed the command you have the basics for putting together a macro.


Lets make a macro to rotate the UCS and PLAN to the right. Here is a copy of the command line and below that is a list of the command inputs and then the resultant macro.

Command line:

Command: UCS
Current ucs name:  *NO NAME*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis] <World>: z
Specify rotation angle about Z axis <90.00>: 90
Command: PLAN
Enter an option [Current ucs/Ucs/World] <Current>: c
Regenerating model.

Command input only:




Do You Really Want To Do This?

Sometimes AutoCAD comes up with a notice noting “Do you really want to do this?” when moving hatches or something related to hatches.

This is most likely (in fact most of the time) related to associative hatches and their boundaries needing to be checked during a move, mirror etc. type command.

This does not always happen in all drawings with lots of hatch, in fact I only encounter it occaisionally these days. So AutoDesk is making hatch better, good for them.

A quick and dirty fix for this problem is to select all hatches and make them non-associative. Then everthing works as normal, well except the hatches don’t follow the outlines, but grip edit hatches make up for that!

Ribbon Creation – My First Ribbon

So in my previous post, I went through the basics of the CUI editor, now I will run through the creation of a ribbon and populate that with panels and commands.

CUI file creation

In order to not disturb the main CUI file for AutoCAD and also make the customisations portable we will need to create our own file to contain the customisations.

To do this, go to the Transfer tab in the CUI editor and go to the right hand column and click on the icon next the drop down box that states “New File”.

Create New CUI file

This will bring up a windows file dialog. Browse to where you want to save this and remember where it was as we will need it for the next step.

Once you click OK you will be returned to the Transfer tab.

Now click on the customise tab and go to the drop down under “customisations in main file” and click open. Or you can click the folder icon next to this drop down (there is a third way to load files but I will run through that later).

Open CUI file

This will open the blank CUI file that was created in the previous step.


Create a New Ribbon

New Tab

Once you have your CUI open, make sure it is selected in the drop down rather than ACADLT.CUIX (or similar). Here it is called TEST.CUIX

New Ribbon Tab

The tree now displayed is everthing you can customise. There is a lot there! We will focus on the Ribbon section for now.

Click the plus next to the Ribbon and you will see TABS, PANELS and CONTEXTURAL TAB STATES listed. For now we are going to look at TABS and PANELS.

Right click on the word TAB and click “new tab”.

New panel

Once we have a panel we will be able to add them to the tab. Next up, right click on the word PANEL and click “new panel”.

New ribbon panel

I have called my panel, test panel. You will see that it has a launcher icon and an another icon called ROW 1. Under the rows is where you place your commands in order for them to show up on the ribbon.

There are three rows in the ribbon. If you need more the slideout is there to allow a larger panel. On my custom ribbon I have a slideout for lesser used layer commands that I sometimes use and find it hard to find in the other ribbon tabs.

Under each panel you can have sub-panels. This is a mini panel that has its own rows. This allows for large buttons and drop downs to be mixed with smaller buttons.


Custom Command

Lets add a new command. This is where scripting comes in. In the full version of AutoCAD you can call LISPs and write DIESEL commands straight into a button command (note that LISP and DIESEL are programming languages and will require knowledge of these to undertake).

However in LT you are limited to only MACROS. MACROS look complicated but are actually a representation of the command line inputs, just in one line.

Create Command step 1

You will notice that the command list is empty as this CUI file contains no commands.

In order to create one, click the little star to the right of the “All Commands Only” drop down.

Create Command step 2

I have called my command “test command”. Once created you will get a new properties box on the right with name, description etc. listed.

The main items to fill in are the name and the macro. This will create a button with a command built into it.

Here we are going to create a button that launches the plot dialog box.

The MACRO code for this (see my macro basics for an explanation):


Once the MACRO is inserted we will assign an icon so it can be seen easily.

Assign Image Step 1

Click on the small arrows on the properties and the button image selection box will be shown. You can assign images, create new ones etc. here.

You can also load an external file for the icon by clicking in the image box and then the three dots to the end of the box (see above image).

Here we are going to use the built in icon for plotting.

Assign image step 2


Making the Ribbon

Once you have completed the command. Drag the command from the command list to the ribbon panel row1 (see above). The command is now assigned to that panel.

Then drag the panel to the tab. The panel is now assigned to the tab.

Click Apply and then OK.

Your Ribbon should now appear at the end of the ribbon list.

Completed Ribbon

If it doesn’t appear you can use the third method (mentioned earlier) of loading a CUI file. Type CUILOAD and a little box will appear.

CUI Load

Click your CUI file name and click “unload”. Now click “browse” and go where you cui was saved and then click “load”. Then click close. The ribbon should now work. I have found this works most of the time whilst loading within the CUI editor fails more often.

DO NOT click on the ACADLT one at the top and then click “unload”, this will break things horribly. If you do, you will need to browse to the ACADLT customisation file and load it again (this is usually stored under your profile in windows, for LT 2015 this is under “C:\Users\yourusername\AppData\Roaming\Autodesk\AutoCAD LT 2015\R21\enu\Support”