Overriding And Resynchronizing Level Attributes


 Product:MicroStation
 Version:N\A
 Environment:N\A
 Area:Administration
 Subarea:N\A

Overriding Level Attributes

Whenever a new attachment is created, a copy of the attachment's levels are made and stored in the master file. At the point when the attachment is made, an attachment level will have the same attributes that its corresponding level in the source file has. After the attachment is made, the attachment's level attributes can be changed independently of its source file levels. The source file levels can also be changed without affecting the attachment's level attributes.

Similarly, when an element is placed on a library level that is attached to a file, a copy of the library level is made in the file.

Up until very recently, the attributes of the library level could not be modified. Based on user feedback, this behavior has been changed. Now any attribute of a library level can be changed, so that a library level behaves somewhat similarly to an attachment level. The attributes of a library level, once used in the MasterFile, can be changed independently of its attributes in its source library file. The source library file levels can also be changed without affecting the files in which the levels are used.

Administrators can control which library levels or attachment level attributes may be overridden in a file. This can be done by setting a configuration variable "MS_LEVEL_EDIT_ATTRIBUTE_LIST".

MS_LEVEL_EDIT_ATTRIBUTE_LIST configuration variable

The "MS_LEVEL_EDIT_ATTRIBUTE_LIST" configuration variable controls which of the level attributes can be edited or overridden. The attributes to be edited can be one or more of the following as a comma separated list: OverrideSymbology, OverrideColor, OverrideStyle, OverrideWeight, ByLevelSymbology, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, GlobalFreeze, Lock and Plot.

OverrrideSymbology encompasses OverrideColor, OverrideStyle and OverrideWeight. ByLevelSymbology encompasses ByLevelColor, ByLevelStyle and ByLevelWeight.

OverrideStyle and ByLevelStyle include both the actual style parameters and their corresponding custom style overrides, if any.

If an attribute is listed in MS_LEVEL_EDIT_ATTRIBUTE_LIST, then that attribute is editable for library levels and attachment levels. If the attribute is not listed in the MS_LEVEL_EDIT_ATTRIBUTE_LIST, then the attribute is not editable for library & attachment levels. All attributes of levels local to the active file are not affected by this configuration variable. The attribute name may be prefixed by "Library" or "Reference." For example:

MS_LEVEL_EDIT_ATTRIBUTE_LIST=OverrideColor

MS_LEVEL_EDIT_ATTRIBUTE_LIST=ReferenceOverrideColor

MS_LEVEL_EDIT_ATTRIBUTE_LIST=LibraryOverrideColor

MS_LEVEL_EDIT_ATTRIBUTE_LIST=ReferenceOverrideColor, LibraryOverrideColor

If MS_LEVEL_EDIT_ATTRIBUTE_LIST is undefined, then all the attributes are editable.
If MS_LEVEL_EDIT_ATTRIBUTE_LIST is blank, then none of the attributes are editable - this is probably not a good idea, since this will lock down on the ability to change any attributes, even attributes such as GlobalDisplay & GlobalFreeze.

Resynchronizing Level Attributes

Given that an attachment/library level can get out of sync with its source level, MicroStation supports a set of key-ins to resynchronize the levels. The key-ins are:

  1. dgnlib update levels [all / overridesymbology / bylevelsymbology / custom]
  2. reference synchronize levels [all /overridesymbology / bylevelsymbology / custom] [ref-logical]

"dgnlib update levels" is a pre-existing key-in. It synchronizes attributes of those library levels used by the current file so that they are the same as those in the library file. The key-in has been expanded to support an additional attribute-control parameter that controls which level attributes are synchronized. The attribute-control parameter can be one of the following:

  1. "all" : Synchronizes each and every level attribute.
  2. "overridesymbology" : Synchronizes only the override symbology related attributes - which include the override color, the override style and the override weight.
  3. "bylevelsymbology": Synchronizes only the bylevel symbology related attributes - which include the bylevel color, the bylevel style and the bylevel weight.
  4. "custom" : Synchronizes attributes as specified by the "MS_LEVEL_SYNC_ATTRIBUTE_LIST" configuration variable.

If the attribute-control parameter is not specified, then MicroStation defaults to "custom".

In addition to synchronizing library levels of the master file, "dgnlib update levels" also drills down all the attachments of loaded models and synchronizes their attachment levels too. This has the advantage that all the levels in the current file can be synchronized with one command.

Reference synchronize levels is a new key-in. It synchronizes attributes of reference levels of the specified attachment (as specified by the [ref-logical] parameter) to be the same as that in the source file of the attachment. If a reference level comes from a level library (as specified in the MS_DGNLIBLIST variable), then the command further synchronizes the level to its attributes in the library. This key-in also takes the additional [all / overridesymbology / bylevelsymbology / custom] attribute-control parameter that controls which of the level attributes are synchronized.

In addition to synchronizing levels of the specified attachment, "reference synchronize levels" also drills down all of its nested attachments and synchronizes their attachment levels too.

Note that synchronizing nested attachment levels is session specific in versions 8.0 and 8.1, since the storing of nested attachment level data was added in the MicroStation V8 2004 Edition.

MS_LEVEL_SYNC_ATTRIBUTE_LIST configuration variable

The "MS_LEVEL_SYNC_ATTRIBUTE_LIST" configuration variable controls which of the level attributes can be synchronized. The level attributes can be defined in the same way as for the MS_LEVEL_EDIT_ATTRIBUTE_LIST configuration variable.

If the MS_LEVEL_SYNC_ATTRIBUTE_LIST configuration variable is undefined, then it will default to MS_LEVEL_EDIT_ATTRIBUTE_LIST. If MS_LEVEL_EDIT_ATTRIBUTE_LIST is also undefined, then the "dgnlib update levels custom" and "reference synchronize levels custom" will default to synchronizing the OverrideSymbology and ByLevelSymbology attributes.

Set RefLevelOverrides key-in

This is a new key-in which controls if the level override for a reference attachment should take effect or not. By default "RefLevelOverrides" is set to ON, i.e. attributes of reference attachment levels can be overridden.

"RefLevelOverrides" is a tcb variable and can be controlled per DGN File.
"Set RefLevelOverrides OFF" will switch off the ability to override attachment levels.
"Set RefLevelOverrides ON" will switch on the ability to override attachment levels.
"Set RefLevelOverrides TOGGLE" will invert the current state of the tcb variable.

If the value of the "RefLevelOverrides" variable is changed, then in order for the change to take effect it is necessary to do a "Save Settings" and reload the file.

When RefLevelOverrides is set to OFF, then all attachment level attributes will be loaded from the source file of the attachment. Thus any change in the level attributes in the source file will be immediately reflected in the attachment also.

Note that while RefLevelOverrides is OFF, it is still possible to change an attachment's level attributes. But this change will be valid in the context of the current session only and is not stored to file. The next time the file is reloaded, the attachment's level attributes will revert to those in its source file.

Related GUI Changes

A few Levels-related GUI changes have been done to accommodate level resynchronization:

  1. The "Update Levels" icon in the Level Manager is now active. When the icon is clicked, depending on which file is selected, one of "dgnlib update levels custom" or "reference synchronize levels custom" will be invoked.
  2. The right-click menu on a selected file in the level manager tree has an additional "Update Levels" item.
  3. There are now a number of level related configuration variables. These have now been consolidated into a new "Levels" category in the configuration dialog.

MS_REF_REATTACH_LEVEL_SYNC_ATTRIBUTE_LIST

(Added to v8.1)

Specifies the list of level attributes that will sync when a reference is reattached. The attributes can be one or more of the following as a comma separated list: OverideSymbology, OverrideColor, OverrideStyle, OverrideWeight, ByLevelSymbology, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, GlobalFreeze, Lock, Plot.

For example, say b.dgn references a.dgn and you want to reattach the reference (a.dgn) and synchronize only the OverrideColor set in the active file (b.dgn) while retaining all of the other attributes originally set in the reference (a.dgn). You would set MS_REF_REATTACH_LEVEL_SYNC_ATTRIBUTE_LIST to OverrideColor. Let's set up a simple scenario with one level. The level in a.dgn has the following attributes:

OverrideColor - RED
OverrideStyle - Border
OverrideWeight - 3

In b.dgn, you override the following attributes for the level in a.dgn:

OverrideColor - GREY
OverrideStyle - 0
OverrideWeight - 0

If you set MS_REF_REATTACH_LEVEL_SYNC_ATTRIBUTE_LIST to OverrideColor and reattach a.dgn, only the OverrideColor attribute will synchronize and you will get the following attribute settings:

OverrideColor - GREY
OverrideStyle - Border
OverrideWeight - 3

Note that I just used the Override attributes to keep the example simple. All of the other attributes (ByLevelSymbology, GlobalDisplay, etc.) will not synchronize when the reference is reattached in the above example.

MS_LEVEL_AUTO_SYNC_ATTRIBUTE_LIST

(Added to MicroStation 2004 Edition)

This variable controls the list of level attributes that will automatically synchronize when a file is opened. The attributes can be one or more of the following as a comma separated list: OverideSymbology, OverrideColor, OverrideStyle, OverrideWeight, ByLevelSymbology, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, GlobalFreeze, Lock, Plot. Each of the above attributes can take a "Reference" or "Library" prefix. If the prefix is not used, both reference and level library levels will be synchronized.

This variable is very similar to MS_LEVEL_SYNC_ATTRIBUTE_LIST, however it is not necessary to manually update the Levels when they become out of sync with the source file. For example, if you would like to always synchronize the ByLevelColor attributes back to the references, but be able to override the references ByLevelWeight, you would set MS_LEVEL_AUTO_SYNC_ATTRIBUTE_LIST to ReferenceByLevelColor. The ByLevelColor will synchronize back to the references automatically when the file is opened, while retaining the overrides made to the reference's ByLevelWeight. If you then choose to synchronize the ByLevelWeight, you can manually Update Level and the ByLevelWeights will synchronize given MS_LEVEL_SYNC_ATTRIBUTE_LIST is set accordingly (see example above).

Following is a short description of the level-related configuration variable available from the "Levels" category:

 

Configuration VariableShort DescriptionLong Description
MS_LEVEL_LIB_DIRLevel Library PathDefines which default directory to look for when exporting levels or importing levels to/from a .csv, .dgn or .dgnlib file.
MS_V7_LEVEL_NAME_PREFIXV7 to V8 Level Name PrefixDefines the prefix to apply to unnamed levels when a V7 design file is upgraded to a V8 DGN file.
MS_V7TOV8_CSVNAMEV7 to V8 Level CSV FileDefines the .csv file which controls how levels are mapped when a V7 design file is upgraded to a V8 DGN file.
MS_V7TOV8_DELETE_UNUSED_LEVELSV7 to V8 Delete Unused LevelsIf set to 1, all unused levels are deleted when a V7 design file is upgraded to a V8 DGN file. This variable is ignored if "V7 to V8 Level CSV File" variable is set.
MS_LEVEL_SYNC_ATTRIBUTE_LISTControl Level Attribute SyncAs explained above.
MS_LEVEL_EDIT_ATTRIBUTE_LISTControl Level Attribute SyncAs explained above.
MS_REF_REATTACH_LEVEL_SYNC_ATTRIBUTE_LIST (Added to MicroStation V8.1)Specifies the list of level attributes that will sync when a reference is reattached.As explained above.
MS_LEVEL_AUTO_SYNC_ATTRIBUTE_LIST (Added to MicroStation 2004 Edition)Controls the list of level attributes that will automatically synchronize when a file is opened.As explained above.

See also

Other language sources

 Original Author:Bentley Technical Support Group