To push values into an automated Word Document output, DriveWorks Pro makes use of “Bookmarks”, a little-known feature of Microsoft Word. The steps to create these placeholders are not as obvious as with SolidWorks documents, or even Excel files. But once you create them they are just as easy to link to as SolidWorks Dimensions, Custom Properties, or Excel Named Fields.
By driving values into a linked Word document, that means in addition to automating the design, update, and creation of SolidWorks models and drawings, DriveWorks Pro can also automate creation of Microsoft Word and other documents. So not only can you quickly create “mass customized” designs for each new client requirement, but you can also auto-generate the documentation that goes with it.
The steps are:
1) Create a Word Document to serve as a template for your desired output.
2) Create “Bookmarks” in the Word Doc where you want to push custom values with each new design.
3) Add the Word Document to your DriveWorks Project.
4) Write desired Rules to control what values get pushed in to the document.
Step 1: Create the Word Document
I’m going to assume everyone knows how to create a Word document! My screenshots here are with Word 2010.
Step 2: Insert Bookmarks
This little-known function in MS Word is found on the Insert tab. You can pre-select some text as the Bookmark, and DriveWorks will replace it with desired values. Or you can place the bookmark at the cursor location and DriveWorks will insert values at that spot.
Microsoft unfortunately doesn’t give very good visual feedback about where Bookmarks are, or what they are called. When you choose to Insert > Bookmark, you’ll see a list of existing Bookmarks and can find out where they exist in the document, but that isn’t very user-friendly. You can turn on the visibility of Bookmarks by going to File > Options > Advanced > Show Bookmarks, and that gives you subtle gray square brackets, but no indication of the Bookmark name.
A great tip is to always use the method mentioned which replaces text, and bookmark some [text in square brackets] to remind yourself what the Bookmark is. This will help indicate what is going on without having to “Show bookmarks”.
Step 3: Add the Document to DriveWorks
This is the easy part. Within DriveWorks Administrator, click on the tree branch for Stage 4: Output Rules > Documents. Choose Add… Word Document. Give it a name (no spaces) to identify it within DriveWorks, and then browse to select the DOC or DOCX which represents the template file. Click “Finish” and you’ll be presented with several values, including all Bookmarks which exist in the file, that you can drive.
Step 4: Write your Rules
This is where the benefit comes from. Rules written in DriveWorks define what values are pushed to the document(s) each time the Project is run. You can, for example, populate the order number, total cost, shipping address, expiration date, salesperson’s name, or a summary list of design criteria for that job.
Each time the Project is run, this Word Document will be updated with the desired values, and saved with the desired filename and location!
Excel and XML are popular too!
In addition to Word outputs, DriveWorks can also create automated Excel outputs. In that case, the Named Field functionality of Excel identifies where values get driven. A powerful and versatile output is an XML file, which can then feed some other downstream process or simply be formatted to display in a web page layout. Other output options include ODBC, SQL, email, and more.