If you have used customized symbols in your display models and want to update them with modified symbols, you can open the display model, generate the graphic, and use MAPSYMBOLIMPORTEXPORT to import the modified symbols. For details, see To Import Symbols.
To import symbols in batch, without a user interface
As an alternative, you could automatically complete the steps above by script. In the command line, load the script file with the SCRIPT command and wait until finished. When you execute several scripts for different display models, make sure to always start with an empty drawing, before open the display model. Otherwise you will save old layers from the previous drawing to the new display model.
The following is a sample script. You can save it as a file with a .scr extension.
CMDDIA 0 FILEDIA 0 _TBDMOPEN [path to your TBDM file] _TBGENERATEGRAPHIC _MAPSYMBOLIMPORTEXPORT _IMPORT [choose options that fit your needs] _TBDMSAVEWhen you are finished with the script, set the variables CMDDIA and FILEDIA back to their original values, which are usually '1'.
To save time, you can import the symbols for many display models in a single operation, using a Microsoft Visual Basic for Applications (VBA) script. The following script is a sample. You can use it as a template, make the required modifications, and then save it as a .bas file.
Attribute VB_Name = "ImportSymbolInto_IM_DM" Sub ImportSymbolIntoDisplayModel() Dim prototypeDWG, templateDWT As String Dim FileDia, CmdDia As Integer Dim displayModelArray(0 To 2) As String 'TODO: Adapt to the number of Display Models to update ' TODO - Adapt to your settings ' Define the path to the Display Models for updating the symbol(s) ' When adding or removing Display Models, please adapt also the size of displayModelArray ' and the loop over all Display Models displayModelArray(0) = "C:\TEST\DM1\DM1.tbdm" displayModelArray(1) = " C:\TEST\DM2\DM2.tbdm" displayModelArray(2) = " C:\TEST\DM3\DM3.tbdm" ' Attention !!! ' Only use the "Generic Graphic" - Application option: Reuse current drawings ' We need the same drawing for all operations ! ' TODO - Adapt to your settings ' Define where the symbol(s) should be imported from prototypeDWG = "C:\temp\symbol_modified.dwg " ' TODO - Adapt to your settings ' Define the template file to be used when open a new DWG templateDWT = "c:\temp\Template\map2d.dwt" Dim currentSDI As Integer currentSDI = ThisDrawing.GetVariable("SDI") If (currentSDI = 1) Then MsgBox "The functions works only with multiple drawings [SDI=0]" Exit Sub End If FileDia = ThisDrawing.GetVariable("FILEDIA") CmdDia = ThisDrawing.GetVariable("CMDDIA") ThisDrawing.SetVariable "FILEDIA", 0 ThisDrawing.SetVariable "CMDDIA", 0 ' Loop all Display Models For inti = 0 To 2 ' Open an empty drawing Application.Documents.Open (templateDWT) ' Open the Display Model ThisDrawing.SendCommand "_TBDMOPEN" & vbCr & displayModelArray(inti) & vbCr ThisDrawing.SendCommand "_TBGENERATEGRAPHIC" & vbCr ' Import the symbol and apply changes to the layers ThisDrawing.SendCommand "_MAPSYMBOLIMPORTEXPORT" & vbCr & "_IMPORT" & vbCr & prototypeDWG & vbCr & "_YES" & vbCr ' Save the changes of the layers to the Display Model ThisDrawing.SendCommand "_TBDMSAVE" & vbCr ' Do not save the drawing ThisDrawing.Close (False) Next ' Reset the system variables ThisDrawing.SetVariable "FILEDIA", FileDia ThisDrawing.SetVariable "CMDDIA", CmdDia End Sub
In the example script, there is a module "ImportSymbolInto_IM_DM" with a sub "ImportSymbolIntoDisplayModel ()". You need to adapt the number of display models and paths to the DWT and the .tbdm files.
To import symbols for multiple display models, using a VBA script
A message will tell you to download the Autodesk AutoCAD VBA Enabler if you have not installed it.
If the system warns you about the macros, click Enable Macros.