The Reference Template Tool in Civil 3D 2018+ employs a new and different approach to the consistent delivery of known good Style resources. The tool allows us to assemble targets, partially manage them, and deliver Style collection resources (targets) by reference.
Use of the Reference Template Tool increases initial drawing open time but increases the consistency of the Style resources delivered.
Project and publication drawings inherit one or more referenced Style and Settings collections and/or AutoCAD Style resource drawings from a Civil 3D template (.dwt) file on creation. Project drawings inherit references to Style collections via a Civil 3D template target.
The Reference Template Tool is the best reason we need the term target to differentiate the various forms employed to construct Style collection container drawings and templates.
Special Delivery in Civil 3D
The Civil 3D Classic Template Target Methods post discusses the methods, major tools, processes, and nuances we need to understand to begin the construct better resource drawings (Style collection targets) that may be employed in a Reference Template Target.
The earlier Civil 3D Template Targets post covered recommendations for the details of Reference Template stack structure and mechanics for building Reference Template Targets in considerable detail.
Let’s review some important behavioral nuances not covered in-depth there.
Reference Template Target Method
If we employ template targets that employ the Reference Template Tool and one or more resources in the Reference Template stack, the managed Civil 3D and AutoCAD Styles referenced are always dependent and conform to those in the attached source drawings.
Proper systematic management of the template targets and of the external target resource drawings means the Style resources will remain current with those external resources.
The Reference Template Tool’s Settings options for each resource can create the illusion that By Selection on the Tool’s Settings tabs is a best practice. Not so. The use of Settings By Selection tends to create a garbage in and garbage out problems. It substantially complicates where the known good resources come from problem for Civil 3D users. See the above-mentioned Civil 3D Template Targets post for solutions.
These issues do not mean that the use of Settings By Selection isn’t a good way to test and identify those same selections in your target development. We just do not want to stop there.
Reference Update Mechanics
Remember that Civil 3D will inject the object model and default code-built Standard Styles and Settings into a start drawing that does not include it. Therefore, the Reference Template Tool must be employed in a dwt that is already setup with Civil 3D’s typical requirements. Practically, it is important to recognize that the Reference template target (.dwt) itself should contain:
- Units and optional Coordinate System setup
- Civil 3D code-constructed Standard Styles and Settings
- Layer Standards and Layer States resources
- Base AutoCAD Styles - Shared Block libraries, Shared Textstyles, and other AutoCAD Style resources – Dimstyles etc
In effect, the target container Reference Template (dwt) file is an acad dwt file in the appropriate STB or CTB publish system with some Civil 3D base specifics set up. See the Civil 3D Template Targets post for more details.
Post Reference Template Setup Mechanics
If the Reference Template Tool cannot locate an attached source drawing on load or on a manual Update in the Tool, the Styles in the current drawing will remain functional and be temporarily localized.
From a maintenance and upgrade perspective, we can manually control the Tool’s synch behavior with the AeccRefTemplateAutoUpdate system variable.
If the reference source drawing cannot be found, the referenced components are still available in the drawing that references them, but they will not be updated until the path to the source including a file name is restored.
- If the name or location of the source has changed, you can change the path in the dialog box by double click to edit the path in the Saved Path column and/or by the browse button to reselect the location and a source drawing.
- If you are temporarily not able to access the path, the referenced components will still be available in the drawing that references them
The referenced components will not be updated until your connection to the defined path and source file is restored.
- If the reference template has been deleted, the referenced components will remain in the drawing that references them.
However, you cannot currently easily employ the Reference Template Tool to attach Style reference resource drawing and then with the Reference Template Tool detach that reference to leave Styles not in use in a drawing. A delete of the source drawing might technically accomplish this, but also leaves broken and unresolved reference attachment references in the drawing. There are other safer and more stable and documented methods to add Style collections to targets.
Detached Maintenance Issues
Reference resources manually detached in the Reference Template Tool interface may leave some nested Civil 3D Styles in a drawing. Remember to employ the Style Purge command after detaching references that include Civil 3D Style references. Obviously, Styles of any type deemed to be in-use may not be purged.
Those Other Important Style Maintenance Tools
The Civil 3D Style Import and Maintenance Work post elaborates the use of the Style Import Tool and mechanics. The limitations of the tool and the need to employ the Style Import Tool in conjunction with other tools (like Style Purge) and processes (like Insert/Explode) cannot be ignored.
The Civil 3D Style Purge command mimics the basic behavior of the classic AutoCAD PURGE command and its command line interface variant -PURGE.
- Style Purge will remove any Style deemed to be not in-use in a drawing.
- Multiple passes of Style Purge may need to be run to remove all the referenced Styles.
If you manually delete Civil 3D Styles in Style collection resource drawings, you should routinely remember to employ Style Purge to remove potential nested Style references.
Identify Styles for a Publish Template Known Good
The PurgeStyles (Style Purge Tool) allows you to get rid of most of the unnecessary Civil 3D Style references in project drawings.
- You can employ PurgeStyles to FREEZE the current presentation of Civil 3D Features to one fixed FORM or Set of Styles in a drawing or a set of project drawings.
- PurgeStyles allows a method to build a Set of publishing Styles – aka those somewhat elusive publish standards.
- If your projects are complex, you will want to divide and conquer the disassembly outlined here and reassemble the results.
- The KISS result is great for publication, reduces confusion, and can improve your presentation and annotative consistency.
Style Purge is Not Permanent
Words of caution: PurgeStyles will also purge Standard Styles too.
You can and should employ the Style Import Tool in your post PurgeStyles procedure to slap these vital Standard Styles and the default Civil 3D Settings back in.
We want the finished drawing to stay stable.
Reset Settings to Standard Style Defaults
Style Purge also cannot remove Styles and Sets currently referenced in Command and Feature Settings. They are still referenced and are in use.
Employ the Style Import Tool with the Import Settings box checked before the Style Purge Tool to import a set of Settings and Command Settings that employ only the default Standard Styles.
- You employ a Style Import before your Style Purge with the Import Settings checkbox checked.
- You import from a dwg or dwt with the Command and Feature Settings all set to Standard.
The Style Import rids your drawing of unnecessary Command and Feature Style settings first. Your repetitive Style Purges will be more effective more quickly.
This Settings import action will remove other named Style references in a drawing and significantly reduce the number of in-use Styles.
The Framework for Civil 3D supplies NoStyles templates with this naked Civil 3D code-built resource with all the Standard Styles. A Framework NoStyles drawing template includes these default Civil 3D code-built Settings.
You can recreate one yourself by starting Civil 3D from the appropriate raw AutoCAD template (.dwt) file. You probably want to set up Units and perhaps some other essential system variables, etc.
Label Style Defaults and The Purges
You should certainly employ LSD (Label Style Defaults) to standardize Label heights for particular Types of Styles in your production/working template(s). It is usually necessary to create and/or edit a naked Settings and all Styles set to Standard prototype with your typical LSD in place.
It can be easy to overlook the obvious.
The most common method to reduce Style complexity and numbers in a drawing or template is to simply Delete the Styles from the drawing.
- Only Styles deemed not in-use may be deleted.
References to Styles in Settings and Command Settings also make Styles display as in-use.
- See the hint in Reset Settings to Standard Style Defaults above
In the Civil 3D Toolspace >>Settings Tab>>in any style collection
Select any not in-use Styles hit the Delete key (or the right click menu>>Delete) to remove the selected Style reference(s) from the drawing.
For Label Style collections where with Parent Styles that include Child Style collections you should first delete the child Styles before you delete the Parents.
More often than we expect, in Civil 3D Style maintenance and improvement practice it is easier to assemble target resources to establish consistency and then separate and delete Styles to categorize and manage the Style Tool collections more effectively.
Find Style References Tool
You can locate where Styles in-use in the current drawing with the Find References pick in the Toolspace>>Settings tab in the Right click menu.
From the resultant References dialog box you can both navigate to the Style reference in the Toolspace or employ the Style Replacement Tool.
Style Replace Tool
In the Civil 3D Toolspace>>Settings tab in the Right click menus of style and/or the References dialog box listing of in-use Styles references, Pick Replace and you can replace one named Style may be with another named Style reference from a list of available Styles.
Both Civil 3D Style and Label Style references can be changed with the Style Replace Tool.
- Currently, there is no command to Replace all style references, collections of Style references, or all Styles in a drawing with the default Standard reference.
In other words, there is now easy way to remove all custom style references in a drawing without employing the Replace command repetitively.
- Therefore, it is usually the best practice work on a copy of the drawing.
Purge all unused Styles from the drawing.
Reimport the Standard Styles from a NoStyles drawing.
Manually Replace all the remaining Styles as required.
For deeply nested Styles in may be necessary to sequentially and repetitively perform this Purge and Replace process.
For some specific Civil 3D Features there are Ribbon-based Style replacement tools (based on the Replace command) that may be employed to replace all references to one type of Style with another.
Post Style Edit, Import, and Purge Process
After any set of Style Import, Addition, Purge, or Deletion processes always remember to post process the drawing target resource.
- Save the drawing
- Run the AutoCAD AUDIT without fixes.
If errors show up, run the AUDIT again with fixes
- Employ the command line interface -PURGE command
- Purge any unnamed block resources from the drawing
- Purge all the Regapps from the drawing
- Save the drawing to overwrite the previous version – do not use QSAVE
The fact that we need some library and file structure to store the external known good Style collections cannot be overlooked.
Release the Power Beyond the Code
Get the Framework for Civil 3D Release 8
The Civil 3D Style Maintenance Handbook Post Series
Updates, additions, and fixes to the posts in this series are on-going.