Navigation:  Microstation > Project Configuration >

Synchronise Title Block with Excel

Previous pageReturn to chapter overviewNext page

Introduction

The following details how to activate and use an Excel file to control the Title Block information within a .DGN file

 

Configuring a project to extract Drawing Titles from Excel

Three new variables must be added into the relevant Microstation Project Configuration file (PCF)

 

Define the path to the spreadsheet; CADTOOLS_PROJECT_DRGTITLES_FILE

 

Define which sheet in the spreadsheet to use; CADTOOLS_PROJECT_DRGTITLES_SHEETNAME

 

Update the Default Batch print option so that it doesn't open the files as read only, if it opens as read only the Titleblock wouldn't get updated.

 

The variables have been defined in the CADtools Example_PCF as follows:

 

TITLEBLOCK INTEGRATION

---------------------------------------------------------------------------------------------------------------------

Defining the variables below will activate Titleblock Integration with the specified Excel file and sheet name

CADTOOLS_PROJECT_DRGTITLES_FILE       = J:Path/to/the/project/area/drawings.xlsx

CADTOOLS_PROJECT_DRGTITLES_SHEETNAME  = Sheet1

MS_BATCHPRINT_NO_READONLY             = 1

 

Only when the variables have been defined within the PCF will CADtools look for an Excel file to find the drawing title block information.

 

Defining the Drawing Titles within Excel

 

Create a spreadsheet where the following information is defined:

 

The heading of the first column should be titled Filename or similar

 

The headings of the subsequent columns should be the Tag Names that are to be controlled within the drawing file

 

In the first column from the 2nd row and downwards the drawing file name needs to be defined

 

Note: The file name must be defined without the .DGN extension, or the drawing file path

 

In the subsequent columns on each row, whatever value is required in the drawing title block should appear in the corresponding 'tag-headed' column

 

Note: A blank cell in the spreadsheet will result in a blank tag value in the drawing.

 

The following screen shot shows how the Excel file is completed:

ExcelTitleBlockScreenShot

 

 

If you are working to a clients drawing border, just change the tag names in the first row of the spreadsheet in order to control these elements with the drawing files. Refer to CADtools_Ustn_Updating_existing_drawings_to_client_titleblocks for more

 

Creating a spreadheet from existing drawings

CADtools_Ustn_Batch_export_titles_to_Excel

The 'Batch Export Titleblock Text to Excel' tool in the 'Batch Processes' task allows you to select a number of existing drawings, and extract all the drawing title to Excel in the required format.

This can then be linked to in the PCF, and the spreadsheet will begin controlling the drawing titles.

 

Updating the Drawing Titles in Microstation

Whenever MicroStation switches to the Sheet model, the macro will open the Excel file in the back ground, extract the current data, and update the relevant tags.

ModelDialog

The Excel file will take precedence over the drawing file, such that the value in the Excel file will always over-write any values within the .DGN file

If it updates correctly, you should see a message in the Microstation ‘Message center’. Similarly errors during the update will show up there too.

 

CADtools_ustn_update_from_excel_message

 

 

Force an update to the drawing titles

For a single drawing

CADtools_ustn_Update_titles_from_Excel

The macros are designed to only run if the XLS file has a newer date-time than when the current DGN was updated. If the current DGN was created via a 'Save As' operation, then you may find that you need to force the macro to re-run.

From the Drawing Setup task, select the 'Update Drawing Titles from Excel' tool

 

For multiple drawings

CADtools_ustn_Batch_Activate_Sheet

To update multple drawings, follow these steps: 1. Update the Excel spreadsheet as desired. 2. Run the 'Batch Activate Sheet' tool form the 'Batch Processes' task.

This will open the sheet model and the macros will automatically run to update the drawing titles

 

 

 

 


Direct link to this topic:

© 2013 Arup