Standards File Naming Utility
Available via configuration, the Standardized File Naming (SFN) utility allows you to quickly and automatically generate file, model, and view names that comply with various file naming conventions. You can also add your own standards and options via an XML file.
When enabled, the utility opens whenever you create a new DGN file, model, saved view, etc. providing you with fields to populate that are used to generate file/model/saved view names that comply with the naming conventions specified by the XMLs.
Enabling the Utility
To enable the utility, the following variables can be defined:
- BB_NAMING_STANDARDS_ENABLE - If defined, enables you to create any file, model and/or view names which is controlled by a standard naming convention defined by BB_NAMING_STANDARDS_FILE.
- BB_NAMING_STANDARDS_FILE - Defines the XML path and file which defines the standard naming convention used to create a prescriptive file, model or view names.
Utility Dialog
Opens when creating a new file, or new model, saved view.
At this point, you may start entering valid data either by manual entry or drop-down lists. Once all required properties have valid entries confirmed (red text turns black), the "OK" button is enabled, and a preview of the generated file name will be displayed at the bottom of the dialog. Clicking OK copies this generated file name into the File Saving Dialog.Utility XML File
The Standardized File Naming Utility dialogs settings are controlled by the XML file specified by the BB_NAMING_STANDARDS_FILE configuration variable.
This document provides the properties which control how a file name can be constructed with the SFN Utility. The XML Document itself is constrained by an XML schema, which can be found in [schema location]. This scheme specifies the following:
<?xml version="1.0"?> <SFNSettings Titles="Some Title">Where Some Title can be replaced by any string, and will appear as the window title for the SFN Utility popup.
These allow the SFN Utility to have different rulesets when creating names in each of the specified scenarios. Each of these nodes may have a GroupName and/or a ShowDesc attribute defined on them. The GroupName places a label on the group header, while ShowDesc is a true/false value which controls whether the description panel is visible when opening the SFN Utility.
<Filename GroupName="FileNames" ShowDesc="true"> … </FileName>
- <Desc>: If included, this sub-node will contain a description of the property visible in a panel at the bottom of the SFN Utility.
- <Attr>: Each control node may have none of many Attr nodes. Including any Attr nodes will make that property appear as a drop-down list in the SFN Utility.
- <Condition>:
Determines when a property will be displayed in the SFN Utility. If Control
node is specified, the property will always be visible. Condition nodes have
the following possible attributes.
- Type (string | required): Can be specified as "Form" to appear within the same window of the SFN Utility, or as "Window" to appear in a subsequent popup window.
- ControlLabel (string | optional): Specify which control label must have a value in order for the current property to be displayed
- Options (string | optional): Used in conjunction with ControlLabel to specify which options must be selected in the specified Control Label in order for the current property to be visible.
-
ControlVariable (string | optional): Specify the name of the Configuration Variable which will populate the property value.
Example Workflow
OpenBuildings Designer comes standard with an example XML document for SFN Utility configuration. You may also choose to create your own XML document to serve the same purpose.
Below is the start of an XML document for the SFN Utilitty.
<?xml version="1.0"?> <SFNSettings Titles="Standard File Naming Utility"> <Filename GroupName="FileNames" ShowDesc="true" > <Control Label="Project Number" Required="true" Order="0" MinChars="4" MaxChars="5" CacheValue="true" Prefix=""> <Desc>Project Number</Desc> </Control> <Control Label="Discipline" Order="3" Required="true" CacheValue="true" Prefix="-"> <Desc>Select from the following options</Desc> <Attr Value="A" >Architectural</Attr> <Attr Value="S" >Structural</Attr> <Attr Value="M" >Mechanical</Attr> <Attr Value="E" >Electrical</Attr> <Attr Value="P" >Public Health</Attr> <Attr Value="C" >Civil</Attr> </Control> <Control Label="Content Description" Order="4" MinChars="1" MaxChars="20" CacheValue="true" Prefix="_" Format="AlphaNumeric_"> <Desc>Model Content Description (only characters A-Z,1,2,3... are allowed)</Desc> </Control> </Filename> … </SFNSettings> |
Similar subnodes must also be created for Model, ModelDesign, ModelDrawing, ModelSheet, and ModelNamedView as specified above. Once the XML document has been created, save it to a folder location that is accessible to OpenBuildings Designer. Remember this file location!
Next, in the configuration variables, select the "File Saving" group and locate the variable named "BB_NAMING_STANDARDS_FILE". Edit this variable to be the exact path of the XML file just created. Then select the "BB_NAMING_STANDARDS_ENABLE" variable and ensure its value is set to "true".
The next time a new file is being created, the SFN Utility should pop up before the Save File Dialog appears. If an error message about the XML file appears, validate that the XML follows the specifications of the schema.