Back

Xref Enhancements and Font Fixes in AutoCAD 2018

Last month Brian Benton presented an overview of what's new in AutoCAD® 2018. This month he dives deeper into the xref features in the new release. Joining him is Jaiprakash Pandey with a look into the SHX font from PDF enhancements. 

Brian Benton

AutoCAD 2018 has several new feature enhancements as a part of its update. The biggest change is the new 2018 DWG file type. This could affect many users and those who share files with outside sources, vendors, and municipalities. Beyond the file change, I can’t point to any one “big ticket” item that makes AutoCAD 2018 a “must have” update. However, the new release does contain several enhancements, additions, or improvements to existing commands, tools, settings, and features that are a long time coming. In this article I will focus on external references or xrefs.

Xrefs are not new, and we have all used them in one way or another. They are likely the most used method of sharing data across drawings, departments, and projects in AutoCAD. Even a single person working a project is likely to use xrefs.

Xrefs are relatively simple to use.  You make a drawing file and want to show linework from a “base” file. Xref that base file into your drawing file and you have it. In this article, I’ll discuss issues that arise and several of the new tools in xrefs that make those issues easier to deal with.

Relative Path

If a file gets moved to a different folder location a reference could break. AutoCAD 2018 will help reduce that because now the default Path Type is now Relative Path instead of Full Path. Better yet, there is now a systems variable where you can set which path type is default. REFPATHTYPE has three settings: 0 for No Path, 1 for Relative Path (the default setting now), and 2 for Full Path. You can keep the Full Path as your default if you wish.

Figure 1: Out-of-the-box setting will create external references as a Relative Path in AutoCAD 2018

With previous releases, many times when I started a new drawing the first thing I did was try to create an xref. As I typically use Relative Paths for my references I could not do this until I saved the drawing file first. AutoCAD 2018 now allows you to set a relative path without having to save your file beforehand. It’s a small thing, but one that can save a few minutes of time if you start with an xref.

Repair Broken Links

If you are working in a file and save it to a new location (for example: saveas), then your relative path references will likely break. AutoCAD 2018 cautions you ahead of time with a pop-up prompting you to update the relative paths and it provides a button (one-click) to automate fixing these links.

Another aid in fixing xref paths are two new options that are available when you right-click a missing reference file in the reference manager. The normal list of options are still there: Attach, Unload, Reload, Detach, etc. But now there are also “Select New Path” and “Find and Replace.” You could always access this type of path change by selecting the file in the manager and going down to the Details section, clicking the path, and re-browsing to the proper location. These right-click options make it a bit simpler.

The “Select New Path” option allows you to more quickly start browsing for the proper pathway, but then gives you the option to apply this change to the other missing xrefs in the current file. “Would you like to apply the same path to the other missing references?” Click yes or no. Nice and easy. 

The “Find and Replace” is similar, but is a bit more controlled. It locates the references that use a specific folder path and replaces them with a new one you browse to. This is nice if you move a base file to a new folder and want to tell your drawing to stop looking over there and start looking over here.

Figure 2: Right-click a referenced file and use the new Find and Replace or Select New Path tools to repair broken links

It’s the Little Things That Help

Changing the Path Type is easy enough—just right-click the file in the manager, select Change Path Type, and select the file path type you want to use. AutoCAD 2018 will now gray out the current file path type, keeping you from accidently picking the current type and having to start over again. It’s not a huge change, but it is something that should be there.

Figure 3: The current file path type of the referenced drawing is unclickable when trying to change it

Many times, a reference file will have other files refenced into it and you get to deal with them. Aren’t you lucky? If those files can’t be found, AutoCAD formerly listed them as “Unreferenced.” Now they are listed as “Orphaned.” You don’t have to guess if they are unloaded or lost.

One of the cool things about the Reference Manager is that it makes opening a linked file easy. Just open the manager, right-click the reference file, and select OPEN. You couldn’t do that if a file wasn’t loaded. You had to load the file, wait, then open the file, then go back and unload the file because it was probably unloaded for a reason. That’s annoying. AutoCAD 2018 allows you to open unloaded files.

Renaming an unloaded xref will no longer automatically load the file. It will remain unloaded.  If you rename a referenced file with a tool other than the Reference Manager, you no longer have to manually reload the file for the name to be applied. You can rename referenced files through the Rename tool or through the CLASSICXREF command.

Perhaps the smallest change but one that might help is the change in wording when a file is opened that contains missing reference files. AutoCAD formerly prompted “Number of missing reference files” but now says “Number of references that are Not Found.”

Wrap Up − TLDR

AutoCAD 2018 has added several small changes to external reference tools that will make using and maintaining them easier. Relative Paths are now default, but you can change that. You can assign a relative path without saving the file first, repeating broken xref paths has new tools and is simpler, changing a file path type is less clunky, missing nested xrefs are now listed as orphaned instead of unloaded, and you can open unloaded xref files from the manager.

Jaiprakash Pandey

SHX Font Import from PDF

When plotted to a PDF, shape fonts or SHX fonts are stored as geometrical shapes because PDFs don’t recognize SHX fonts. When you import these PDF drawings back in AutoCAD you will get polylines instead of a shape font.

With AutoCAD 2018 you can easily convert these geometries into SHX fonts. To explain this feature, I will use the drawing shown in Figure 1, which contains lots of text information in the form of a SHX font.

Figure 1: Sample drawing with SHX font

Start with a blank drawing and select the PDF Import tool from the Import panel under the Insert tab or use the PDFIMPORT command. From the file browser, select the PDF file and click on Open; keep all options on the Import PDF window unchanged and click OK.

In the inserted PDF file, when you hover your cursor over SHX text you will notice that they are inserted as Polylines.

Recognition Settings

Before actually using the text conversion tool we need to configure its settings. Select the Recognition Settings option from the Import panel under the Insert tab. A new PDF Text Recognition setting window will open up with a list of default SHX fonts in the upper left panel of the window as shown in Figure 2.

Figure 2: PDF Text Recognition settings

In the “SHX fonts to compare” panel, use the Add button to add all the fonts that are similar to the fonts used in the imported PDF file. You can also remove fonts that are not similar by using the Remove button at the bottom of this panel. To sort the order of fonts, use the up and down arrows.

In the list, try to put similar fonts at the top of the list to get quick output because AutoCAD starts its comparison from the first font in the list and gradually moves down in the list if required fonts are not found. Also, select the checkboxes for all the fonts you want to include in the comparison from this list.

You can change the layer setting and also change the recognition threshold for the geometries to be recognized as fonts. Lowering the recognition threshold could result in the conversion of geometries to similar but different fonts. For our example, I will keep this value at 95 percent.

Select the “Use best matching font” checkbox if you want AutoCAD to compare the geometries in the drawing with all the fonts in the list, then select the best matching font from the comparison. Once these settings are made, click on OK and select all SHX text geometries from the drawing. You can include Mtext and other geometries in this selection set; they will be automatically filtered out from text conversion.

Figure 3: Recognize SHX Text message

When the text conversion is complete you will see a window with stats of the text conversion as shown in Figure 3. If AutoCAD fails to convert all geometries into SHX text, you can try converting them again by decreasing the recognition threshold and selecting smaller chunks of geometries in a selection set.

Combine Text

You can combine the converted text into a single Mtext unit as well with the Combine Text tool on the Import panel. Here, you can also customize the settings of the Combine Text tool.

Click on the Combine Text tool on the Import panel under the Insert tab or use its command equivalent TXT2MTXT. Click on the settings option on the command line and the panel shown in Figure 4 will appear.

Figure 4: Text to MText Settings

If you have single line text that you want to convert to multiline text without combining them into a single Mtext object, then uncheck the first checkbox of this panel. You can also keep “Force uniform line spacing” unchecked if you want to keep the original line spacing between the Text lines you are combining. Once these settings are made, click on OK then select the text and press enter again.

All the selected text will be combined into a single Mtext unit. You can also access this tool from the Express tools panel in AutoCAD.

Have you upgraded to AutoCAD 2018? Do you have a favorite feature in this or maybe one of the last couple versions you have grown to love? If so, drop me a line and let me know—I would love to hear what everyone else is finding to be their favorites. Email to: walt@functionsense.com
– Walt Sparling, AutoCAD Content Manager, AUGIWORLD

About the Authors:

Brian Benton is a Senior Engineering Technician, CAD Service Provider, technical writer, and blogger. He has more than 20 years of experience in various design fields (Mechanical, Structural, Civil, Survey, Marine, Environmental) and is well versed in many design software packages (CAD, GIS, Graphics). He is Cadalyst magazine’s Tip Patroller and Infinite Skills AutoCAD training video author. Contact him at cad-a-blog.com.

Jaiprakash Pandey is a Mechanical Engineer currently working as a CAD Corporate trainer. He is an AutoCAD Certified Professional and an Autodesk Expert Elite member. He provides training in AutoCAD, CATIA, and other CAD products to corporate clients. He is a regular contributor to AUGIWORLD magazine and also develops AutoCAD video courses for Pluralsight and his own platform, SourceCAD. You can reach him on his blog: www.thesourcecad.com

Appears in these Categories

Back