Home Search

DriveWorks Pro 21
Text File From Variables

Send Feedback
DriveWorks Labs PowerPacks can be updated more often that the main release.

Please consult the Online Help File for the most up to date information and functionality.

Text File From Variables

DriveWorks 14 (and newer) and the Specification PowerPack contain functionality that will achieve similar results as this plugin gives.

Please see the following topic for more information:

The Text File from Variables plugin will create a text file (.txt) from variables, prefixed with TD, created in a project.

This plugin is machine specific and should be installed on each machine where specifications can be created. (DriveWorks Administrator, DriveWorks User, DriveWorks Autopilot, DriveWorks Live)

DriveWorks Plugins running inside SOLIDWORKS
This plugin can either be used in DriveWorks Administrator (In which case it will run as part of the DriveWorks Addin inside SOLIDWORKS during model generation) or added in to DriveWorks Autopilot to run as part of the Autopilot function. If you wish to use this plugin from the DriveWorks addin inside SOLIDWORKS, then you will need to ensure that the plugin version is matched to the exact version of DriveWorks that you are using. To make sure that the versions are matched, right click on the file DriveWorks.Engine.dll that comes with the plug in, and check its version number against the version that appears on the splash screen when you launch DriveWorks.

Install\ Uninstall

The installation file is available from the DriveWorks Community website at https://my.driveworks.co.uk/ (login required).

Once downloaded double click the DriveWorksLabsTextFileFromVariablesSetup.msi file to begin the installation process. DriveWorks and SOLIDWORKS should be closed while installing the plugin.

Once installed the plugin is automatically loaded in DriveWorks.

The plugin is uninstalled from Windows Programs and Features, and will be listed as DriveWorks Labs Text File plugin.

DriveWorks should be closed and restarted once the plugin has been uninstalled to remove it from the plugin list in the DriveWorks settings.

Settings

Once installed the plugin can be configured by:

  1. Launching DriveWorks Administrator
  2. Click the Settings button from the header bar
  3. Select plugin Settings from the list on the left of the Settings dialog
  4. Scroll to the plugins section at the bottom of the main window
  5. Select DriveWorks Text File plugin
  6. Click the Settings button

Edit Project List

The plugin needs to know the name of each project it is to run on.

To Add a project to the list

  1. Click Edit Project List to open the Add Projects dialog
  2. Enter the name of each project  in the top field

    This is the name of each project the plugin is to be run on, and is case sensitive.

  3. Click Add after each project name that is added.

To remove a project that has been added to the list

  1. Select an item in the list view
  2. Click Delete to remove the project.

Details

The plugin can be run when during the Finish or Release process. This is set from the Details are by selecting the required process from the drop down box

Requirements

For the plugin to create the text file variables need to be applied into each project the plugin can be run on.

Variables in the Project

The chart below lists the variables required in the project with example rules and meanings.

Variable Name

Rule/Meaning
TD1FileName
  1. DWSpecificationID & ".txt" - Will create the file 5.txt in the location the specification files are stored (5 will change according to the DWSpecificationID)
  2. "C:\DriveWorks Pro\Specifications\Text Files\"&DWSpecificationId&".txt" - Will create the file 5.txt in the C:\DriveWorks Pro\Specifications\Text Files\ (5 will change according to the DWSpecificationID), any folder that does not exist will be created by the plugin.
TD1HL1"This is the header" - Will place the text This is the header on the first line of the text document
TD1L1"Price = " & DWVariableTotalPrice - Will place the text Price = $250 on the first line below any header lines used in the text document (where $250 is the result of the variable referred to in the rule)
TD1L2"Quantity = " & QuantityReturn - Will place the text Quantity = 2 on the second line below any header lines in the text document (where 2 is the result of the form control Quantity)
TD1L3IF(AdditionalNotesReturn="","Delete",AdditionalNotesReturn) - Will remove the line from the text document when no entries have been made in the form control AdditionalNotes, will place the text coming from the form control AdditionalNotes into the third line of the text document.
TD1FL1"This is the footer" - Will place the text This is the footer on the first line after all Line text has been inserted.
TD2FileName

DWSpecificationID & "-2.txt" - Will create a second text document with the name 5-2.txt in the location the specification files are stored (5 will change according to the DWSpecificationID)

TD2HL1"This is the first header line" - Will place the text This is the first header line on the first line of the second text document
TD2HL2"This is the second header line" - Will place the text This is the second header line on the second header line of the second text document
TD2L1"This is the first line of text" - Will place the text This is the first line of text on the first line below any header lines used in the second text document
TD2FL1"This is the first footer line" - Will place the text This is the first footer line on the first line after all Line text has been inserted in the second text document.
TD2FL2"This is the second footer line" - Will place the text This is the second footer line on the second footer line in the second text document.