Apply the same view attribute to multiple models (Connect U16)

Hello, is it possible to apply view attributes to multiple models in a file with a single tool / key-in or command? Our programmer has a VBA macro that creates multiple sheet models in a file (anywhere from 5-200) but a few of the view attributes need to be adjusted after those models have been created. I've looked in the help file & searched the forum but I don't see anything about this. 



  • Barry, yes. Our programmer is looking into changing the VBA code for the future, but this is for DGN files that have already been created. Apparently Bentley changed the process when creating models with a macro in connect as compared to V8i. Our V8i macro copies the default model in the file (which has all of the view attributes properly set & settings saved) to make the new models. Connect doesn't honor those settings when copying the default model to create the new models, hence the reason for the need to change view attributes in multiple models.

  • Connect doesn't honor those settings when copying the default model to create the new models

    If I said I was surprised to hear that, I would be lying.

    The answer to the question is yes you can do that and here is how I suggest you do it using VBA.

    1. Create a new DGN or DGNLIB file (if DGNLIB, create it in a folder that assigned to MS_DGNLIBLIST (though ultimately not important as I will explain later)
    2. Open the new file and set the view attribute settings that you want to have applied to the sheet models, and then create a Saved View using Method:From View. This will be our Saved View Template.
    3. Load the Batch Processor and add however many DGN files you wish to update.
    4. Load the Command Script
    5. Select all the DGN files and change the Initial Model to Default Model Only and press apply to selection.
    6. Press Process Batch Process Job.

    The Macro I wrote will loop through all Models in the DGN file; it will ignore Design and Drawing Models and only operate on Sheet Models. When the View Attributes have finished being applied to all sheet models, the Saved View is removed from the DGN file.

    In the test case below, I started with a single DGN file, changed the model from Design to sheet. I created a mix of elements which would be effected by the change of View Attributes, its quite self explanatory. I then duplicated the model 2 times. The only difference between the models content is the Text String at the top is changed to reflect the model name. With 1 test file created, I duplicated it and again changed the same text string to reflect the different file name. These 2 test files should be sufficient to prove that multiple files containing multiple sheet models can have the same View Attribute settings applied view a single Saved View. The Saved View I created turns off all of the following view attribute types: 

    • ACS Triad
    • Custom Line Styles
    • Line Weights
    • Text
    • Hatch/Patterns
    • Dimensions
    • Fill 

    As you can see, it works fine however the only thing I was unable to achieve programmatically was accessing the Saved View from the DGNLIB in the same way I would with a Text or Dimension Style in a DGNLIB, so I had to instead specify the full path to the DGNLIB containing the Saved View Template. However, the macro was written quickly and seems to do just fine what I set out to achieve.

  • You should be able to do this with a batch process. Create a text file with the required key-ins to set the attributes






    Open Batch Process and set the path to the text file. Load all of the .dgn files and make sure Process All Models is selected.

    Microstation CONNECT -

    ORD - 2021 R1

    ORD 2022 R1.1 -

    ORD 2022 R3 -

    Microstation v8i SS 10 -

    Power InRoads v8i -

    ProjectWise -

  • Thanks Barry, I'll pass this on to our programmer.

  • Mwlong, thanks for the input. It's been a while since I've used script files.