XREFs and Layers

A colleague of mine was struggling with numerous issues when using XREFs. The two main ones where having multiple Layer States with XREF prefixes that couldn’t be removed and the other was not wanting to see the XREF layers.

Layer States Dialogue for no XREFs does not work with Ribbon pulldown
Layer States Dialogue for no XREFs does not work with Ribbon pulldown

The first issue was frustrating as whilst there is an option to disable these is in the layer states manger dialogue, checking the box does not disable them in the Ribbon pulldown. Duh. So the solution ended up being, delete the layer states in the XREF.

The second issue was easy to solve as AutoCAD has this feature built-in and it works! It works with both the Layer Pulldown, Layer Palette and Classic Layer! Wow!

Layer Drop Down showing XREF layers
Layer Drop Down showing XREF layers

This is how to remove XREF layers from these palettes. You will need a filter (yup AutoCAD has layer filters!)

Layer Pallette indicating the filter section
Layer Palette indicating the filter section

On the panel on the left, click XREF, this will now show the list of layers for the XREF. Click on the checkbox below that states Invert Filter and voila, you have a list of layers without XREF layers within.

Rotate Viewport

One of my colleagues was asking how do I rotate a view in a specific viewport. I was all over this, and was like there are several ways, however the way I use is to use UCSFOLLOW, then rotate the UCS, turn off UCSFOLLOW and voila view rotated in viewport that is different to that of the model space.

Another colleague was like why don’t you rotate the viewport itself, that would be easier?

I was like, viewports don’t rotate? He rotated the viewport and wow! The view inside followed. This works for any angle!

The system variable that controls this is VPROTATEASSOC which has been in AutoCAD since 2010!

Rotate Angle for Manual Rotate

One of my colleagues just asked, where is the dynamic feedback for the rotate angle when using rotate.

I played with the setting for a bit and discovered that angular information is not available during rotate! How dumb is that?

There is a work-around though. Go to Drafting Settings (right click on OSNAP, OTRACK etc, they all bring up the same dialogue, just on a different tab) then go to POLAR TRACKING and set the Increment Angle to 1 and the Polar Angle measurement to last segment.

Polar tracking option for 360 degree angle feeback
Polar tracking option for 360 degree angle feedback

Now when rotating you will see 360 degree information, useful for rough rotates by eye.

Remember to change these back after your rotate command! Thinking about it, it is probably possible to turn this into a script and button so that you have a “Rough Rotate” command.

 

Secure Load

If you, like me, use LISPS you will find that a new very useful feature has been added to AutoCAD 2014. They have introduced Secure Loading of executables, which in principle is a good thing.

However if you like me are struggling to get the Trusted Locations to work, you can go back to the “legacy” behaviour (load everything anyway) by going to settings –> system –> executable file settings and turning off this feature.

Secure Load
Secure Load

Frames

One of my colleagues was asking, why can I not turn the frame off around this imported image? IMAGEFRAME was not turning the frame off. It turns out that the drag-and-dropped image was actually a PDF, and therefore the frame is controlled by PDFFRAME, so its worth noting the imported image type in order to control things like this.

However, it should be noted that all “frame” commands (IMAGEFRAME, PDFFRAME etc. can now be controlled by one single command FRAME. This appears to be valid from version 2012 onwards.

——

Excerpt from help, AutoCAD 2013 (c) AutoDesk.

Changing the setting for FRAME changes the IMAGEFRAME, DWFFRAME, PDFFRAME, DGNFRAME, XCLIPFRAME, POINTCLOUDCLIPFRAME, and WIPEOUTFRAME settings to the same setting as the new FRAME setting.

0 – The frame is not visible and it is not plotted. (The frame temporarily reappears during selection preview or object selection.)

1 – Displays and plots the frame.

2 – Displays but does not plot the frame.

3 – The settings vary for all objects with frames in the current drawing: images, underlays, clipped xrefs, clipped point clouds, and wipeout objects do not all have the same frame settings.

Rogue Layers

A colleague of mine had dropped in some blocks from an external source and found that they had two layers and wanted only one. They wanted to move all objects on one layer to another within the blocks.

Normally I would go about this, if there were no blocks involved, by using QSELECT. Then select the desired layer in the Ribbon and PURGE out the unused layer.

However as they are in blocks this does not work as the selection ignores the lines in blocks and just selects the blocks themselves. As we were after only specific lines in these blocks I was faced with exploding them all or some clever LISP.

However I discovered two commands that would not require LISP or lots of work! If you don’t want the layer LAYDEL should do the trick but the one that was really awesome was LAYMRG. This merged the two layers and purged out the unused one and kept all the blocks intact!

This can be found on the ribbon in the following location:

Ribbonpositionlaymrg

Layer Merge (LAYMRG) icon location
Layer Merge (LAYMRG) icon location

Power Command Line

I discovered today that some code can be typed straight into the command line in AutoCAD. I had not realised this, I thought all code had to be loaded as a routine.

The following changes the PSLTSCALE for all layouts!

 

(foreach lay (layoutlist)(command "_LAYOUT" "_Set" lay "PSLTSCALE" 0))

 

UCS World

I received a set of drawings today from a colleague, whilst this is not unusual, the drawings all had differing UCS settings, which was unusual, most of my colleagues do not touch the UCS.

Usually I reset the UCS to world and carry on. I like my modelspace to to be set to world so when I copy and paste the rotation stays the same to the screen. I tend to then rotate the UCS in viewports as and when required.

This time, typing UCS, W to reset to world UCS left me with this, a wonky UCS.

Wonky UCS
Wonky UCS

The UCS is wonky, or Y is not up the page. The square in the UCS indicates it is set to WORLD, so I was confused.

The problem was not that the view was set to the UCS but the UCS was (kind of) set to the view. I will explain. (See bottom of post for a quick explanation).

If you type VIEWTWIST, it should be set to 0 for the UCS to be the way I wanted it. I found it was set to 270!

wonkyucs02

Now I have run into another problem, the VIEWTWIST variable is readonly!

So lastly I found that typing PLAN and setting to WORLD reset everything to how I wanted.

wonkyucs03

Interestingly this problem seems to be similar to the one a while back with rotating the view in AutoCAD LT.

—-

For a quick method of the above, if the UCS is not in the default position and it is set to world, then the view has been rotated. To rotate the view back, type PLAN, then WORLD. Or click on the arrows above viewcube in full AutoCAD.

Rotate from Viewcube
Rotate from Viewcube

Constrained

One of colleagues today noted that today he had annoying boxes. When I looked at his screen he had something like this.

Strange Boxes
Strange Boxes

These strange annoying boxes are constraints, part of AutoCAD’s parametric system, found under the Parametric Tab on the ribbon (strangely).

In order to use constraints you need to click the INFER constraints button on the bottom left of the status bar. This allows objects drawn in this mode to have the Parametric constraints. This button looks like this

Turn on Constraints
Turn on Constraints

Or this, depending on whether you use icons or not.

constraints01Once on you can draw your objects to be constrained. Here I have drawn a rectangle and a polyline. If I move the polyline the rectangle will deform as the polyline and the rectangle are linked or constrained together.

constraints04

constraints05

If you do not want this constrain feature on this object anymore you can click on the object and then delete constraints on the ribbon.

constraints06

Once removed the object returns to a plain old rectangle polyline.

constraints07

Remember to turn off the INFER constraints button before drawing anything else as all items drawn will have this parametric capability.

 

 

Not the Point

One of my colleagues had put a point in a block to stop it from “growing in size”. Whilst this is an ingenious work-around, it is easier to control the size of points if you don’t want them to be massive when zoomed out in a drawing.

If you type DDPTYPE into the command line you will get this dialogue box.

DDPTYPE Dialog
DDPTYPE Dialog

The circle with a cross is my usual selection for style, the point size can be relative to the screen, where 5% is usually about right, or for my colleague’s requirements, absolute. This is in the base units for the drawing, e.g. MM or INCHES.

Note that you can set POINTS to be tiny dots and therefore nearly impossible to see and these do not scale at all. This is useful as sometimes a drawing can be full of points that are “invisible”.