Take a look inside 2007 release

 

 

 


MechWorks s.r.l.
via Vallescura, 8/2
40136 - Bologna, Italy
http://www.mechworks.com

 

 

 

 

 

Enhancements

Administration Tools

The new Administrative Control Panel of DBWorks

This tool is a reference for the Administrator displaying a centralized directory of the administrative tools available in DBWorks.
A simple web interface offers a brief explanation for each topic, a link to the help for more information and often the ability to open a dialog for direct editing.

the directory is available on the left as a tree, the specific topic is opened in the right panel

Copy or move documents across projects in a simple interface

This tool allows to copy or move the content of entire projects into other projects.
The interface displays two panels: from and to allowing to select the source projects and the destination project.
For a detailed selection you are able to filter the files using a textual search or select/deselect the file manually.
A confirmation dialog allows you once more to check the list of files to be moved or copied across the projects.
Note that the disk location of the documents is not changed, only the assignment to projects is affected.

Autocad 2007 enabled dwg viewer

Vectorial DWG Viewer with Autocad 2007 support

A proprietary DWG Viewer is now available in DBWorks 2007 for the preview and the full preview of DWG files (up to the Autocad 2007 file format).

The viewer, when used in the Full Preview tab, can zoom/pan the DWG, supports multiple sheets DWG, show the selected layers and print (with full Print Preview capability) the DWG.

BOM

Assignment of the Physical Quantity directly from the Create a new Bom Item dialog

It's now possible to assign the physical quantity directly from the Create a new Bom Item dialog.
A physical quantity of 0 will reset the physical quantity and unit of measure assignments.

Create New Bom Item default directory

The Insert New Bom Item default directory is now set equal to the parent’s document directory.
If the parent’s document directory is empty, the directory is assigned to the XLS directory.

New options in the Order BOM position numbers dialog

Two new options are available in the Order BOM Position Numbers dialog

Force CAD order only if not absolute

The Force the current CAD native order function has now the option Force CAD order only if not absolute.
When checked, DBWorks applies the CAD native order only to the components for which the position number is not absolute, that is for which the PARENT_CHILD_BOM_POS field is NULL.
The new opt ion is also exposed as 3rd optional parameter to the DBWShell command SetBOMAbsolutePositionNumbers.

Apply any action also to sub-assemblies

When checked, DBWorks applies the Force the current CAD native order or Clear all the absolute positions actions recursively to each sub-assembly.

New options in the Open/Save→Save section

Two new options are available in the Open/Save→Save section:
Open/Save→Save→Always assign absolute BOM position numbers on save
Open/Save→Save→Force CAD order only if not absolute

When checked, the functionality Order BOM Position Numbers is automatically applied at each assembly save. For an explanation of these concepts, please read the paragraph New options in the "Order BOM Position Numbers" dialog

Browser behavior

Full Preview Tab

The functionality has been improved so that is no more necessary to activate the Tree Page’s Full Preview tab before activating the Browser’s Full Preview tab.

Default ORDER BY fields

The grids lists default order can now be declared in the SCHEMA\TABLES2.DFL with the special clausole @ORDER followed by the Table Name and the list of the ORDER_BY fields:

Syntax

@ORDER <table name> <comma separated fields list>

Notes

The table names must be localized in each language, following the standard rules of the TABLES2.DFL DBCustomizer will manage all these issues automatically.

Example

Tables2.DFL

…
@ORDER SEARCH DESCRIPTION
@ORDER COMPOSED_OF T,DESCRIPTION
@ORDER DRAWING SHEET_FORMAT
@ORDER PROJECT CREATION_DATE
…
In the above example:

Configurations

LAST_MODIFIED_DATE and LAST_MODIFIED_BY alignment at check-in

The LAST_MODIFIED_DATE and LAST_MODIFIED_BY fields are now always aligned at check-in for all the configuration records of the same file, so being no more necessary to set the option Environment→Configurations→ Align fields on configuration checkin

In the Remote Access case, also the REPLICATION_DIRTY flag is correctly set

Cutlist

NO_BOM attribute set automatically for part-generated weldment insertions

Inserting a part into a weldment structure generates both a derived-part relation and a cut-list item in the parent part:

DBWorks marks now as NO_BOM the cut-list records generated by a part (in the above example, the Cut-list-item3(1)):

This enhancement allows to create a correct BOM:

Data Input Form

Improved interface for Not Null Fields

  1. Fields already not null are no more displayed with the Pink color if more fields are still to be assigned in not visible tabs:

    previous

    actual
  2. Tabs containing null fields are automatically displayed:

    previous

    actual

$(CONFIGURATION_DESCRIPTION) macro for ID and DESCRIPTION

The new macro name $(CONFIGURATION_DESCRIPTION) can be used in the options:
Data Input→Macro definition for configured record ID
and
Data Input→Macro definition for configured record DESCRIPTION


DBWorks settings

Configuration properties

Resulting datainput form

$LINKED_FIELD macro

The new macro $LINKED_FIELD allows the display of linked tables values, even if in full UNICODE format ( NVARCHAR ). So, for example, by using this macro it will be possible to display a Unicode Secondary Table value in the Input Form and in the Data Grids.

Syntax

$LINKED_FIELD(<DOCUMENT_table_key_field>,<Linked_Table_Name>,<Linked_Table_Field>,"<SQL_variant_filter>")

Parameters

<DOCUMENT_table_key_field>: the current record DOCUMENT table field to which to link the value
<Linked_Table_Name>: the name of the linked database table
<Linked_Table_Field>: the field name of the linked database table for which the value will be returned
<"SQL_variant_filter">: any valid WHERE … SQL statement, enclosed in quotation marks, with one and only one parameter defined as %s, parameter that will be replaced dynamically with the value of the DOCUMENT_table_key_field for the current record
Example

We would like to display both an English and a Chinese description in the same Input Form.
The English description will be contained in the field DESCRIPTION, the Chinese description in the field DESCRIPTION2.

Suppose that our DBW_UNICODE_MAPPING_TABLE contains the following records:

We will assign to the field DESCRIPTION2 the value:

$LINKED_FIELD(DESCRIPTION,DBW_UNICODE_MAPPING_TABLE,SECONDARY_STRING,"PRIMARY_STRING='%s' AND SECONDARY_LANGUAGE='CHINESE'")

In this macro: <DOCUMENT_table_key_field> = DESCRIPTION
<Linked_Table_Name> = DBW_UNICODE_MAPPING_TABLE
<Linked_Table_Field> = SECONDARY_STRING
<"SQL_variant_filter"> = "PRIMARY_STRING='%s' AND SECONDARY_LANGUAGE='CHINESE'"

Please note the '%s' variant parameters, that will be replaced by the value of the DESCRIPTION field

Whenever the edit control will loose its focus, the displayed result will be the following:

More, the same value will be displayed in the standard Data Grids:

Of course, the DESCRIPTION2 field could be easily populated for all the documents with the above macro, by simply writing a DESCRIPTION2.LST with a proper .DEFAULT directive:

.DEFAULT $LINKED_FIELD(DESCRIPTION,DBW_UNICODE_MAPPING_TABLE,SECONDARY_STRING,"PRIMARY_STRING='%s' AND SECONDARY_LANGUAGE='CHINESE'")

Improved .LST files with .SQL commands

There is no more need for the final STOP/SET DB DBWORKS/START sequence when accessing a different database.

Example

Old way (DBWorks 2006):

.SQL
STOP;
SET DB DBWCUST;
START;
SELECT ...
STOP;
SET DB DBWORKS;
START;

New way (DBWorks 2007):

.SQL
STOP;
SET DB DBWCUST;
START;
SELECT ...

Database Management

All the _DATE fields are now managed as HMS dates

All the values used for the _DATE type fields are now in the YYYY/MM/DD HH:MM:SS format.
_DATEHMS is now a compatible but obsolete field name suffix.

Delete Records: check for any active referencing parent documents

DBWorks checks now for any active parent document still referencing any document that will be deleted and proposes a confirmation dialog for choosing if to continue with the deletion of the selected documents or if to skip any document that still has a referencing parent document:

DBWARM

DBWArm: new option for avoiding to show all the projects when not assigned to any project

By default ( and for allowing small companies to be not too much worried about Projects↔Users assignments ), if a user is not assigned to any project, then that user can see all the projects in his Project Tree. With the new option available in the DBWArm options page:
Environment→DBWArm→Never show Projects if not assigned
when checked, this behavior is changed so to hide all the projects in the Project Tree if a user has not been assigned to any project with the DBWorks Projects↔Users Assignment manager.

Short-cut bar items visibility depending on the DBWArm Group

It is possible to hide/show particular items of the DBWorks Short Cut bar files ( SCHEMA\DBWSCBAR.* ) by prefixing the item rows with a string like [DBWARM:Group:<DBWArm Group>].
Example
…
Tools Setup
      Edit Material Database,system\edit_material.vbs,120
      Custom Property Manager,system\bomcust.vbs,53
      Office Integration Parameters,system\Officetemplates.vbs,52
      Define Revision schema,system\Edit_Revisions_schema.vbs,56
      Register Documents in the Database,system\Register_Documents_in_Dbworks.vbs,63
      [DBWARM:Group:DBWorks Admin]Bom Designer wizard,system\EditExcelBOMs.vbs,132
      ME10 Integration Parameters,system\ME10Setup.vbs,139
      DBWorks Conversion Wizard,system\dbworks_conversion_wizard.vbs,86
      Select Coding Wizard,system\SelectCodingWizard.vbs,106
      [DBWARM:Group:DBWorks Admin]Visual Cues Manager,system\visual_cues_manager.vbs,106

DBWArm Editor: new right for the Transfer Ownership functionality

A new right is available in the Remote Access page for denying/allowing the Transfer Ownership of a document:

DBWArm Editor: synchronization with the DBW_PROJECT_USER table

Any operation on the DBWORKS_USERS table will now correctly update the entries in the DBW_PROJECT_USER table.

DBWArm Editor: script fired when a user is added/modified/removed

The script <GlobalParametersPath>\LST\DBWARM\OnDBWArmUsersTableUpdated.VBS is fired whenever a new user is created/removed/updated in the Users table of the DBWArm Editor.
The script receives the following self-explaining input parameters:
DBWorksApplicationName
DBWARM_Action		USER_ADDED | USER_REMOVED | USER_MODIFIED
DBWARM_UserName
DBWARM_UserFullName
DBWARM_UserGroup
DBWARM_UserNameWas		Not null if DBWARM_Action is USER_MODIFIED
Example
'
' OnDBWArmUsersTableUpdated.VBS
'
MsgBox "OnDBWArmUsersTableUpdated.VBS" & vbcrlf &_
	"Application  : "	& DBWorksApplicationName & vbcrlf &_
	"   Action    : "	& DBWARM_UsersTableAction & vbcrlf &_
	"   User name : "	& DBWARM_UserName & vbcrlf &_
	"   Full name : "	& DBWARM_UserFullName & vbcrlf &_
	"   Group     : "	& DBWARM_UserGroup &_
	"   User name was : "& DBWARM_UserNameWas

Event Log

CHANGE_CURRENT_PROJECT event

The event of changing the current project is now logged in the Event Log table.

File Attachments

Introduction

DBWorks 2007 introduces a support for managing file attachments without registering them in the DOCUMENT table.
For such feature, a special table named DBW_ATTACHMENTS is managed by DBWorks.
DBWorks detects, at startup time, the presence of such table and enables the support for file attachments.

DBW_ATTACHMENTS table structure

The DBW_ATTACHMENTS table must have the following minimum structure:

T			varchar(1)
DESCRIPTION		varchar(80)
FILE_NAME		varchar(256)
FILE_DIRECTORY		varchar(256)
REVISION		varchar(20)
DOCUMENT_UNIQUE_ID	int

All the fields must be LOCALIZED for the database language currently in use. So, for example, for a German installation, the field FILE_NAME must be declared as DATEI_NAME.
The table as primary keys must have fields DOCUMENT_UNIQUE_ID, FILE_NAME and FILE_DIRECTORY.

Add an Attachment… functionality

A new RMB popup menu entry Add an Attachment … is available for selecting the files to be attached to the currently selected document:

Script OnCustomQueryTab_Attachments.LST

An OnCustomQueryTab_... type script must exist in the LST directory for displaying the attachments currently related to the selected document.
See the Custom Query tabs in the Tree Page topic for more details about this type of scripts.
A sample of this script (that can be found in the DEMO_LST folder) is the following:
.VBSCRIPT
sub main()
	DBWInit(TRUE)

	' the parent document unique id
	documentUniqueId = DBWInput("@DOCUMENT_UNIQUE_ID")

	' to be used for revision-dependent attachments ; still not supported
	documentRevision = DBWInput("@DOCUMENT_REVISION")

	if documentUniqueId = 0 then
		exit sub
	end if

	nameFieldT			= DBWLookUp("NAME_FIELD_T")
	nameFieldDESCRIPTION		= DBWLookUp("NAME_FIELD_DESCRIPTION")
	nameFieldFILE_NAME		= DBWLookUp("NAME_FIELD_FILE_NAME")
	nameFieldFILE_DIRECTORY		= DBWLookUp("NAME_FIELD_FILE_DIRECTORY")
	nameFieldDOCUMENT_UNIQUE_ID	= DBWLookUp("NAME_FIELD_DOCUMENT_UNIQUE_ID")

	' build the tab query
	query =_
		"SELECT " &_
			nameFieldT & "," &_
			nameFieldDESCRIPTION & "," &_
			nameFieldFILE_NAME & "," &_
			nameFieldFILE_DIRECTORY & "," &_
			nameFieldDOCUMENT_UNIQUE_ID &_
		" FROM DBW_ATTACHMENTS WHERE " &_
			nameFieldDOCUMENT_UNIQUE_ID & "=" & documentUniqueId

	' return the query to DBWorks
	DBWOutput "@QUERY",query,ForWriting
end sub
To activate the script, simply copy it in the LST folder.

Preview of the attachments

The preview of the attachments is supported within the range of types supported by the available installed viewers.

To enable viewing or editing of such preview, you have to set option
User Interface→Preview→Full preview of generic documents
and eventually
User Interface→Preview→Full preview of generic documents launching the associated applications

RMB commands for the attachments

The following command are available on the RMB popup menu for an attachment record:

Open

Opens the attachments with the application associated by Windows

Explore

Opens the attachment’s containing folder

Remove this attachment

Removes the selected attachment from the parent document

"As Built" ADW-generated attachments

In case the attachment is an ADW generated As Built model (see specific ADW help for further information), the RMB shows an additional entry

Compare with current model

Compares the structure of the As Built model with the structure of the current model The output is the standard BIN\DBWDIFF.EXE output

Inventor

Support for Inventor 2008

Starting from sp1.0 (planned for summer 2007) DBInventor 2007 will be ready for Inventor 2008.

Previous revisions visualization available for Assemblies with Inventor 11/2008

With Inventor 11 (or newer), DBInventor can now visualize "on the fly" a previous revision of an assembly without the need of a full restore of the assembly structure in a separate directory.

Link Mode

Improved fields alignment for new Drawings

New Drawings have now the Input Form populated with the Part/Assembly record fields values declared in the option Environment→Link Mode→Align DrawingsÛPart Fields

Localization

Polish language

The Polish language is now supported. The database collation must be properly set to the Polish collation in order to show the Polish characters correctly.

Log file

TRACE_CUSTOM_PROPERTIES

This new parameters enables the logging of any error that may happen while processing the file’s custom properties. A special Log file, named DBW_CustomPropertiesMonitor.LOG, is written in the %TMP% directory.

It's suggested only when experiencing problems with the file custom properties.

Master Drawing Mode

New option: Always create Master Drawing on a new revision

When checked, the Master Drawing is created (by invoking the script OnCreateMasterDrawing.LST) at every New Revision or Increment Revision State operation.

New WorkingSet function for copying the Master Drawings to the clipboard for Copy/Paste operations

The new function Copy Master Drawing file names to clipboard is available from the RMB Working Set menu:

When applied to the current Working Set, DBWorks will look for any available Master Drawing file for the documents in the Working Set, and copy the file names to the clipboard, so to allow a further Paste operation from any Windows application:

Mechworks Standalone Client

Single Window Application

DBWorks Standalone starts now as a single-window application

Add Document functionality can register assembly structures

For SolidWorks 2006 files (or newer), the Add Document functionality asks now for the registration of a whole assembly structure:

The registration is performed by using the SolidWorks Document Manager component.

In order to provide the necessary file locations parameters to the SolidWorks Document Manager, a new option has been added in the General→More … section:

As indicated in the option’s title, you must assign only the ROOTS of the repository folders for the SW files to be registered.

The registration process considers also all the Options→Environment→Configurations parameters, included the Save all configurations automatically.

For such reason, the parameters are now enabled in the Options→Environment→Configurations page when started from a DBWorks Standalone system.

The corresponding DBWShell command ( AddDocument ) has now a 3rd optional parameter for traversing an assembly structure:

DBWShell("AddDocument <document path name> [ <parent unique ID> [ <registerChildDocuments> ] ]")

where
<registerChildDocuments> [0/1] 1: register the child documents; when 1, no input is requested

Example
DBWShell("AddDocument C:\MyAssemblies\MyAsm.sldasm 123456 1")
Example
This example (registerWithStdAlone.vbs ) shows how to register an assembly structure by using the DBWorks Standalone server:
Set DBWApp = CreateObject("DBWAlone.Api")
okDBW = DBWApp.CallBack( "@StartApplication" ) 'support for DBWArm/Login dialog
asmName = replace("C:\MyAssemblies\MyAsm.SLDASM"," ","|") 'the assembly is known to the script
parentUid = 123456 'the parentUid is known to the script
traverseChildComponents = 1
okDBW = DBWApp.CallBack("AddDocument " & asmName & " " & parentUid & " " & traverseChildComponents )

DWG/DXF Batch Plotting

Batch plotting of DWG/DXF files is now supported through the eDrawings viewer (if available).

"Draft Quality" eDrawings plotting

A new option (by default unchecked) in the Plot Setup page is available for eDrawings plotting from a DBWorks Standalone system:
Use Draft quality when plotting with eDrawings from DBW Standalone

When using this option, the needed memory resources are much less than when plotting with standard quality, but, of course, the resulting plotting quality is low.

Open

New RMB function: Open Part/Assembly Configuration

The new function pops-up the Configuration Selector dialog even if the option
Open/Save→Open→Choose configuration when opening a document
is unchecked

PDF layers

Additional parameter for the DBWShell("MDOpen")

The DBWShell("MDOpen") command supports now a 2nd optional parameter that, if set to "1", enables the writing of the MD… entities on a special PDF layer named "MechWorks".
The layer is always created as Locked.

Syntax

DBWShell("MDOpen <PDF full path name> [<okLayer>]")

Input

<PDF full path name> the full path name of the PDF file to modify
<okLayer> 0: write the graphical entities on the native layer; 1:write the graphical entities on the "MechWorks" layer

Output

@MDID the handle of the PDF just opened
Example
sub main()
	DBWInit(TRUE)

	call DBWShell("MDOpen C:\MyPdfFiles\MyPdfFile.pdf 1")
	mdid = DBWResult("@MDID")
		
	if mdid<>0 then
		rgbcolor = rgb(255,0,0)
		DBWShell("MDAddText " & mdid & " 10 10 APPROVED!!! Arial 18 0 0 " & rgbcolor & " 0")
		DBWShell("MDClose " & mdid)
	end if

end sub

Plot

Support for custom SHEET_FORMAT(printer_name).LST when plotting TIF or PDF documents

The DBWShell("PlotPDFTIF") command supports now any LST\SHEET_FORMAT(printer_name).LST file for plotting TIF/PDF documents with paper sizes larger than A3.

Multiple sheets plotting with MW Standalone Client

The Mechworks Standalone Client supports now the option Plot Setup→Plot Multiple Sheets.

Remote Access

Out-of-date downloaded local copies highlighted in RED color

Any already downloaded foreign document is now highlighted in RED color if the LAST_MODIFIED_DATE value is newer than the file date.

The minimum time difference that will be highlighted is 1 minute.

Ability to download foreign documents in checked-out state

The download of a foreign document in checked-out state is now allowed by DBWorks.

The document being downloaded, however, is the last approved revision of the document being checked-out, so to permit to the company requesting the foreign document to access the document, even if the document is currently in a new revision phase on the remote company that owns it.

Ability to preview remote documents with the server-side-file-transfer enabled

DBWorks can now preview foreign documents even if the server-side-file-transfer modality is enabled.

In order to have this functionality running properly, the field DBW_PREVIEW_IMAGE must be created in the DOCUMENT table as type Image:

At each save, DBWorks will update the field with a low-resolution image of the document being saved.

The low-resolution image will then be used by the Download functionality for previewing the document.

New option: Always download linked documents

If this option is checked, (dafault is unchecked)

Environment→Remote Access→Always download linked documents

the program will always propose to download also any linked document (following the Environment→Link Mode options settings)

New RMB command: Remote Access→Share/Unshare this Project

Two new commands:

are available in the RMB→Remote Access popup menu of a Project for managing the _SHARED COMPANY_ID suffix (see the Interface for managing remote documents help topic for more details).

Under DBWArm, both commands are available if the user has the Create new Project priviledge

Rename/Replace

eDrawings available in the Replace References dialog

Reassign Project on Rename

After a successful Rename, DBWorks applies now the following options (if assigned):

DBWorks ignores any ProjectÛDocument assignment made manually by the user.

Revisions

New options page Revisions→Outputs

A new set of options controls the automatic creation of Excel_BOMs or file exports at checkin or approve time (see main help for details).

The available Output File Extensions must be declared into the parameter file SCHEMA\DBWRevisionsOutputFileExtensions.TXT.

An example of this parameter file is the following:

;--------------------------------------------------------------
; DBWRevisionsOutputFileExtensions.TXT
;
; DBWorks Revisions Output File Extensions File
;
;--------------------------------------------------------------
; EXTENSION <extension>
EXTENSION PDF
EXTENSION TIF
EXTENSION DWG
EXTENSION DXF
EXTENSION DWF
EXTENSION IGS
<empty line>

The created Excel_BOMs are accessable through new RMB menu entries:

New command @GETNEXTFROMSCRIPT

The new command @GETNEXTFROMSCRIPT can be used in the REVISION.LST file for assigning a default handler of the revision name builder, without the need to activate the OnNewRev.LST script.

Example
REVISION.LST
@GETNEXTFROMSCRIPT MyOnNewRev.LST

Revisions Containers

The purpose of this new feature is to display, in the same Tree User Interface, older revisions of assemblies or structures for which it is available a .TREE file, created at approval time.

Database requirements

A new field named DBW_EC_TYPE of type varchar(50); the field must be exposed to both the Generic and Project database views

How it works

When building the Tree structure, DBWorks looks for any Generic or Project type document for which the DBW_EC_TYPE field is not empty. If not empty, DBWorks gets the 1st level children of the document with DBW_EC_TYPE not null.
For each 1st level child, it then looks for the PARENT_CHILD_REVISION field, and, if not null, it looks if any .TREE file is available for the PARENT_CHILD_REVISION of the 1st level child document.
If the .TREE file is available, it will be used for building the sub-tree.

Recommendations

If a Project will be used as Revisions Container, it must be set to a RELEASED state.

Example

In the picture below, the Generic Document with ID=”RevisionsContainer” has the DBW_EC_TYPE set to an arbitrary value; the PARENT_CHILD_REVISION value for the PARENT_CHILD relation between the “RevisionsContainer” Generic Document and the “Wilwood Master Cylinder” Assembly Document is set to “B”.

On the top of the picture, you can see that the “Wilwood Master Cylinder” Assembly is displayed with its current database relations and values, while in the sub-tree under the “RevisionsContainer” Generic Document, the same assembly is displayed with its structure at Revision=”B”. It is interesting to note that the component “Reservoir Cover” has been deleted from the database, so it is represented in the Tree as an OBSOLETE document.

The markers and on the right side of each ID help to remember that the structure is not available in the database, but it has been loaded from a .TREE revision file.

Tree File Comparison tool

New comparison html output view for tree files. The tool can be activated to compare revision of assemblies be removing or renaming the local file ...\DBWorks\bin\dbwdiff.exe

The ability to create and display the view is also offered by API as a function of the object DBWJComp.CodeObject. method: showComparisonAsWebPage <treeFileFullPath1>,<treeFileFullPath2> and can be used from scripting as in the following VBScript example:

Set codeObject = CreateObject("DBWJComp.CodeObject")
  codeObject.showComparisonAsWebPage "C:\myAsm.SLDASM.03.TREE","C:\myAsm.SLDASM.02.TREE"
Set codeObject = Nothing
where the last revision (or the main referenced tree) should be passed as the first parameter, for compatibility with the DBWorks native Compare command.

scripting

.NET scripts

DBW2007 introduces the support for native .CS or .VB applications written in .NET

DBW2007 uses a custom engine (named DBWCSSUI) for driving the .NET runtime.

This engine needs some extra coding for managing correctly the assembly references.

Prerequisites

  • .NET 2.0 must be installed
  • If working with SolidWorks, SolidWorks 2007 is the minimum version supported

Background on .NET assemblies

Any given .NET assembly has the following major characteristics:

  • file name
  • assembly name
  • assembly module name
  • assembly namespace

The naming convention for the .NET framework was always simple: all three are the "same".

  • file name: System.Windows.Forms.dll
  • assembly name: System.Windows.Forms
  • assembly module name: System.Windows.Forms.dll (the original file name embedded into assembly file header)
  • assembly namespace: System.Windows.Forms

Microsoft has broken it's own rule with the way how Visual Studio 2005 generates interops: the file name always has prefix "interop." and does not match any more the assembly namespace. What leads to the situation when it is not possible to reconstruct the file name from the assembly namespace (this is what the DBWCSSUI engine does).

The solution is to use the DBWCSSUI explicit loading directive //css_ref : this resolves the loading problem.

About how to reference the namespace from the code, in C# it is resolved through the using directive; VB equivalent is Import.
Thus if you want to use, for example, System.Windows.Forms your code needs to have Import System.Windows.Forms.
In addition to this, VB compiler has it's unique feature imported namespaces which means that you can nominate namespaces to be used not from code but on the compiler level.
This is the reason why you do not have to have Import System.Windows.Forms in the code if you are inside of the VB project: nice feature but inconsistent and creates some confusion.

DBWCSSUI does not pass any extra compiler directives thus you must have Import <namespace> in code if you want to use a particular namespace.

As a final note, renaming of the assembly file is not a very good idea in general as it creates mismatch between Assembly file and module name. Some applications may refuse to load such assemblies.

Development from Visual Studio 2005 VB.NET

VB.NET keeps the code files separated from the form files, so a "merge" action is needed for putting all the code into one script file: just insert all methods from the form module into class of the form designer file.
As an example, the installed template file for new VB scripts is a result of merge a "VB form" and a "VB form designer" files.

Default environment

DBWorks 2007 provides a Default Environment for using the DBWCSSUI engine. The new folder BIN\DBWCSSUI contains all what is needed for creating and running .NET scripts with DBW2007. The standard DBWScrpt.LIB has been ported as a Class Library in the assembly MW.DLL.

Parameters in cssui.config

CacheBaseDir: The root directory for caching the local script compilation results.

DownloadBaseDir: The root directory for downloading (caching) all remote scripts.

CodeProviderDll: Location of the VB compiler assembly. This value is passed at run time to the CS-Script engine through it's configuration file.

DebugMode: Boolean flag, which indicates that the script should be compiled with debug information included.

SimpleRemoteCaching: Boolean flag, which indicates when the remote script dependency files (assemblies and importable scripts) have to be analysed for changes.

  • True: Files are analysed only if the primary remote script file is changed. This is the quickest algorithm as it does not require reading the remote script every time it is executed.
  • False: Files are analysed every time the primary remote script file is executed.
This setting is used to optimise the runtime performance of remote scripts.

The following settings are related to the actions to be performed before or after opening script(s) in VS

VSBaseDir: Root directory where all temporary C# and VB projects are generated.

VSCleanResx: Boolean flag, which indicates that any automatically generated .resx files (for temporary VS project) should be deleted on after closing the IDE.

VSUpdateIncludesOnClose: Boolean flag, which indicates that new //css_imp should be automatically injected to the script file after closing the IDE. The injection is usually triggered by adding .cs/.vb file to the project by developer. New directives are marked with "//auto-generated" comment.

VSUpdateRefsOnClose: Boolean flag, which indicates that new //css_ref should be automatically injected to the script file after closing the IDE. The injection is usually triggered by adding assembly references to the the project by developer. New directives are marked with "//auto-generated" comment.

Event scripts

For each "standard" script ( *.LST or *.SPT ), DBWorks 2007 looks if a .NET version exists in the same directory.

The .NET version has the naming convention:

  • <original script name>.VB for a VB.NET script
  • <original script name>.CS for a C# script
So, for example, if you like to create a C# version of the OnOK.LST, you must name it as OnOK.LST.CS, and DBW2007 will automatically invoke it instead of the originary OnOK.LST

The following is an example of OnOK.LST.CS:

//css_reference MW.DLL;
using System;
using System.Drawing;
using System.Windows.Forms;

public class DBWDotNet
{
	static public string Main( 
		string ApplicationName,
		string ModuleName,
		string ConnectionDSN,
		string ConnectionUID,
		string ConnectionPWD,
		string ConnectionDBMSName,
		string ConnectionORACLE_SERVER,
		string ConnectionORACLE_SCHEMA_OWNER,
		string ConnectionBomDSN,
		string IsInBatchOperation,
		string CurrentDocumentBatchOperationIndex,
		string BatchOperationDocumentsCounter
	){
		MW.DBWLib.Initialize(ApplicationName,ModuleName,ConnectionDSN,ConnectionUID,ConnectionPWD,ConnectionDBMSName,ConnectionORACLE_SERVER,ConnectionORACLE_SCHEMA_OWNER,ConnectionBomDSN,IsInBatchOperation,CurrentDocumentBatchOperationIndex,BatchOperationDocumentsCounter);
		
		String fileName;
		fileName = MW.DBWLib.DBWInput("FILE_NAME");
		MessageBox.Show("FileName=" + fileName);

		MW.DBWLib.DBWOutput("@OKDATA","1",MW.DBWLib.ForWriting);

		String description;
		description = "Created By OnOK.LST.CS";
		MW.DBWLib.DBWOutput("DESCRIPTION",description,MW.DBWLib.ForAppending);

		MW.DBWLib.Terminate();

		return "";
	}
}

Looking at the above script, you can see the following features:

  1. the header must contain the //css_reference MW.DLL directive, for using the DBW standard script library
  2. the main class must be named DBWDotNet
  3. the entry point must be named Main and declared as the above sample; the self-explaining parameters are passed from DBWorks to the script at run time
  4. each call to the DBW standard script library must be prefixed with MW.DBWLib.
  5. all the variables must be explicitly declared
  6. the very first call to the DBW standard script library must be the MW.DBWLib.Initialize , passing the parameters as shown in the above example; the Initialize calls internally the DBWInit(TRUE)
  7. the very last call to the DBW standard script library must be the MW.DBWLib.Terminate()
  8. all the methods of the MW.DBWLib class have the same syntax as documented in the standard DBWorks Help file, at the Programming DBWorks chapter

The same example shown above can be written in VB.NET as follows:

'//css_reference MW.DLL;
Imports Mechworks
Imports Microsoft.VisualBasic

Public Class DBWDotNet

	Public Shared Function Main(ByVal ApplicationName As String,ByVal ModuleName As String,ByVal ConnectionDSN As String,ByVal ConnectionUID As String,ByVal ConnectionPWD As String,ByVal ConnectionDBMSName As String,ByVal ConnectionORACLE_SERVER As String,ByVal ConnectionORACLE_SCHEMA_OWNER As String,ByVal ConnectionBomDSN As String,ByVal IsInBatchOperation As String,ByVal CurrentDocumentBatchOperationIndex As String,ByVal BatchOperationDocumentsCounter As String) As String
		MW.DBWLib.Initialize(ApplicationName,ModuleName,ConnectionDSN,ConnectionUID,ConnectionPWD,ConnectionDBMSName,ConnectionORACLE_SERVER,ConnectionORACLE_SCHEMA_OWNER,ConnectionBomDSN,IsInBatchOperation,CurrentDocumentBatchOperationIndex,BatchOperationDocumentsCounter)

		Dim fileName as String
		fileName = MW.DBWLib.DBWInput("FILE_NAME")
		MsgBox("FileName=" & fileName)

		MW.DBWLib.DBWOutput("@OKDATA",1,MW.DBWLib.ForWriting)
		if ucase(right(fileName,7))=".SLDPRT" then
			Dim id as String
			id = left(fileName,len(fileName)-8)
			Dim description as String
			description = id & " - Created By OnOK.LST.VB"
			MW.DBWLib.DBWOutput("DESCRIPTION",description,MW.DBWLib.ForAppending)
		end if

		MW.DBWLib.Terminate()

		return ""
	End function

End Class

Looking at the above script, you can see the following features:

  1. the header must contain the directive ' //css_reference MW.DLL; ( a single apex, a space, then the //… ) , for using the DBW standard script library
  2. apply the same rules described for the .CS script

Callback scripts

The UserProcessDocument function, necessary to the DBWWalkTree functionality, it is supported by creating a special module named:
DBWWalkTree_UserProcessDocument.VB
with a template like:

' //css_reference MW.DLL;
' //css_reference MechWorks.Interop.DBWAlone.DLL;
Imports Mechworks
Imports Microsoft.VisualBasic

Public Class DBWDotNetUserLib
	Public Shared Function UserProcessDocument( ByVal uniqueId As String ) As String
		MsgBox(">>UserProcessDocument<< uniqueId=" & uniqueId)
		return "0"
	End function
End Class

The function UserProcessDocument is invoked by the MW.DBWLIB.DBWWalkTree for allowing the programmability of the actions on each document being processed.

Add-ins

An Add-in is a generic application, written in any language ( even .NET ), exposing, thorugh a Visual Basic COM interface, the following four functions:

Start(BSTR applicationName)
Stop()
OnMenuItemClicked(long itemID)
OnMenuItemEnabled(long itemID)

An add-in template, written in VB.NET is the following:

Imports System.Runtime.InteropServices
<Microsoft.VisualBasic.ComClass()> Public Class Class1

    Public Function Start(ByVal AppName As String) As Boolean
        MsgBox("Start")
        Start = True
    End Function

    Public Function [Stop]()
        MsgBox("Stop")
    End Function

    Public Function OnMenuItemClicked(ByVal itemID As Integer) As Boolean
        MsgBox("OnMenuItemClicked " & itemID)
        Return True
    End Function

    Public Function OnMenuItemEnabled(ByVal itemID As Integer) As Boolean
        If itemID = 3 Then  ' just for testing, disable item = 3
            Return False
        End If
        Return True
    End Function

End Class

It is important that the following attributes must be set for the add-in:

DBWorks 2007 launches at startup a special script named AddinStartup.VBS, located in subfolders of the special folder BIN\AddIns. From within the startup script, the DBWShell(“LoadAddin …”) command must be invoked, passing the name of the add-in, the CLSID of the COM object to be installed and the XML file for the definition of the menus.
If the loading of the add-in’s DLL will be successful, the Start(BSTR applicationName) method will be invoked by DBWorks.
When DBWorks will stop its execution, the method Stop() will be invoked for each loaded add-in.

The syntax of he LoadAddin command is the following:
DBWShell("LoadAddin <Addin name> <Addin ProgID> <Addin XML menu definition file>")
Where: Addin name any unique name for the add-in
Addin ProgID the ProgID for creating the add-in object
Addin XML menu definition file the name of the XML file containing the menu structure of the add-in

The supported format of the XML file for the menu structure is the following:

<?xml version="1.0" encoding="utf-8" ?>
<DBWMenu>
	<DBWSubMenu Name="My1stAddinMenu">
		<DBWMenuItem Name="Func1" ID="5"></DBWMenuItem>
		<DBWMenuItem Name="Func2" ID="6"></DBWMenuItem>
		<DBWSubMenu Name="MySubMenu1">
			<DBWMenuItem Name="Func3" ID="1"></DBWMenuItem>
			<DBWMenuItem Name="Func4" ID="2"></DBWMenuItem>
		</DBWSubMenu>
		<DBWSubMenu Name="MySubMenu2">
			<DBWMenuItem Name="Func5" ID="3"></DBWMenuItem>
		</DBWSubMenu>
		<DBWSubMenu Name="MySubMenu3">
			<DBWMenuItem Name="Func6" ID="4"></DBWMenuItem>
		</DBWSubMenu>
	</DBWSubMenu>
	<DBWSubMenu Name="My2ndAddinMenu">
		<DBWMenuItem Name="Func7" ID="7"></DBWMenuItem>
		<DBWMenuItem Name="Func8" ID="8"></DBWMenuItem>
	</DBWSubMenu>
</DBWMenu>

The attributes ID must be UNIQUE in the file, being those numbers passed to the functions OnMenuItemClicked(long itemID) and OnMenuItemEnabled(long itemID)

Example
C:\Program Files\DBWorks\BIN\AddIns\MyDBWAddin\AddinStartup.VBS
sub Main()
	DBWInit(True)
	DBWShell("LoadAddin MyDBWAddin ClassLibrary1.Class1 AddinMenu.xml")
End Sub

Using the XML menu definition file described in the above example, the displayed menu structure will be the following:

Database BLOB-type fields support

The DBSQL engine supports now the following commands for loading/saving a file into a BLOB-type (Binary Large OBjects) database field:

FILELOAD <table name> <key field name> <key field value> <BLOB field name> <file path>
FILESAVE <table name> <key field name> <key field value> <BLOB field name> <file path>
Example
Suppose to have already added a field DBW_PREVIEW_IMAGE of type Image to the DOCUMENT table (as seen before, in chapter)

To insert the file C:\MyPictures\MyPicture.JPG file into this field for a record with UNIQUE_ID=123456789:

DBSQL>FILELOAD DOCUMENT UNIQUE_ID 123456789  DBW_PREVIEW_IMAGE C:\MyPictures\MyPicture.JPG;

To extract the image from the same record to the file C:\MyPictures\MySavedPicture.JPG:

DBSQL>FILESAVE DOCUMENT UNIQUE_ID 123456789  DBW_PREVIEW_IMAGE C:\MyPictures\MySavedPicture.JPG;

Both commands can be invoked from a .LST/.VBS script as follows:

sub main()
	DBWInit(TRUE)
	DBWExecSQL("FILELOAD DOCUMENT UNIQUE_ID 123456789  DBW_PREVIEW_IMAGE C:\MyPictures\MyPicture.JPG;")
	MsgBox "OK LOAD =" & okDBW
	DBWExecSQL("FILESAVE DOCUMENT UNIQUE_ID 123456789  DBW_PREVIEW_IMAGE C:\MyPictures\MySavedPicture.JPG;")
	MsgBox "OK SAVE =" & okDBW
end sub

New DBWShell commands: FileZip, FileUnZip

Syntax

DBWShell("FileZip <command> <file path>")

Parameters

<command> New | Add | Create
New <file path>the zip file name
Add <file path> a file to add to the zip archive
Create Creates the zip

Example
DBWShell("FileZip New " & replace("C:\MyFolder\MyZipArchive.ZIP"," ","|"))
DBWShell("FileZip Add " & replace("C:\MyFolder\MyFile.DOC"," ","|"))
DBWShell("FileZip Create")

Syntax

DBWShell("FileUnZip <zip file path> <output folder>")

Parameters

<zip file path> The zip archive to unzip
<output folder> The folder into which the files will be unzipped

New DBWShell commands: SetPrimaryDatabaseTables, ResetPrimaryDatabaseTables

Sets the names of the Primary Database Tables to the assigned ones.

The passed tables are supposed to have EXACTLY the same structure of the original ones

Syntax

DBWShell("SetPrimaryDatabaseTables <permanent> <DOCUMENT table name> <REVISIONS table name> <PARENT_CHILD table name>")

Parameters

<permanent> [0/1] if 1, the primarty tables are pemanently set to the new names (useful for starting a Standalone Client on a new primary tables set)
if 0, the table will be reset as soon as the script terminate its execution

When the Primary Tables are different from the standard ones, the DBWorks Browser shows a notification in it’s title

ATTENTION: this command must be used only by expert DBWorks Administrators, and with an intensive testing of the scripts that will use it
Example
DBWShell("SetPrimaryDatabaseTables 0 DBW_ASBUILT_DOCUMENT DBW_ASBUILD_REVISIONS DBW_ASBUILT_PARENT_CHILD")

The following command resets the Primary Database Tables to their original values

Syntax

DBWShell(“ResetPrimaryDatabaseTables”)
		

New DBWShell command EMail

A new command EMail is available in the DBWShell interface.

Syntax

EMail <action> <parameter> <value>

Parameters

<action> [New | Data]
  • If <action> = New then the following parameters are accepted:
    <parameter> Notification
    <value> <sent to User identifier>

    where: <sent to User identifier> <user ID>@<company ID>

  • If <action> = Data then the following parameters are accepted:
    <parameter> SUBJECT
    <value> the eMail Subject string

    <parameter> BODY_TXT
    <value> a line in text format for the body of the eMail message

    <parameter> BODY_HTML
    <value> a line in HTML format for the body of the eMail message

    <parameter> ATTACHMENT
    <value> a valid file path for sending the file as attachment to the eMail message

  • For an example, please look at the specific example for the Workflow script OnWorkflowStateHasChanged.LST

    New DBWShell command ShowDocumentSelectorDialog

    A new command ShowDocumentSelectorDialog is available in the DBWShell interface. The command shows the Document Selector Dialog used by DBWorks for multiple checkout/checkin/approve, for briefcase import/export, etc.
    See CommandShell documentation for details.

    New DBWShell command GetTreeParentProject

    A new command GetTreeParentProject is available in the DBWShell interface.
    The command returns the Unique ID of the nearest Parent Project in the current Tree structure.
    When used with no parameters, it returns the nearest Parent Project Unique ID of the currently selected item in the Tree. When invoked passing a Unique ID as parameter, it first tries to select a document in the current Tree with the Unique ID equal to the one passed as parameter, then returns the nearest Parent Project in the Tree structure.

    See CommandShell documentation for details.

    New script OnDrop.LST

    This script is fired when dropping a set of files/documents on a target document.

    Please refer to DBWShellCommand documentation for details.

    Improved OnShowPreviewLabel.LST script

    It allows to customize the text that is displayed in the label of the Preview window of a document.

    Please refer to DBWShellCommand documentation for details.

    Improved ShowConfirmationDialog shell command

    The ShowConfirmationDialog command has been enhanced for supporting the deletion of records and files, in the same way the user interface does.

    Please refer to DBWShellCommand documentation for details.

    Improved LoadQuery command

    The LoadQuery command has been enhanced for supporting the output of the “filter” modality into:
    • Document Page grids, if the Document Page is the current page of the Browser
    • the search grid of a DBW Feature Manager window

    Please refer to DBWShellCommand documentation for details.

    Improved EditRecord and EditRevisionRecord commands

    A new optional parameter is available for passing the name of a field that will be displayed when the Data Input Form will be opened. Due to this is possible to change the default tab shown when dialog is displayed.

    Example
    call DBWShell ("EditRecord 45 1 CATEGORY3")

    because the field CATEGORY3 is shown in tab "Classification", such tab is shown as active when the dialog is opened.

    Please refer to DBWShellCommand documentation for details.

    Improved CreateNewBomItem command

    When called with no parameters, and if a Tree control was activated with a valid selection, it displays the UI Create a new Bom Item dialog.

    Please refer to DBWShellCommand documentation for details.

    Improved PlotPDFTif command

    For the PDF case only, the command applies the setting of the option Plot setup→Plot multiple sheets

    Please refer to DBWShellCommand documentation for details.

    New parameter @IS_DERIVED_CONFIGURATION passed to the Dataentr.lst script

    • @IS_DERIVED_CONFIGURATION (Input)
      When the @CONTEXT=ADD_CONFIGURATION, a new parameter is passed to the Dataentr.lst for understanding if the current configuration is a derived configuration or not.
    • @NO_SAVE_ALL_CONFIGURATIONS=1 (Output)
      If returned from the Dataentr.lst with value "1", DBWorks will avoid to save all the configurations automatically, even if the relative option is set

    Please refer to DBWShellCommand documentation for details.

    Solidworks

    x64

    Starting from sp1.0 (planned for summer 2007) DBWorks 2007 will be installable in a special edition for running with SolidWorks 2007 x64 edition.

    Windows Vista edition

    DBWorks can be run under Vista Operating System.

    Important Note: currently DBWorks supports Windows Vista only with the UAC ( User Account Control ) disabled.
    click here for details
    Future builds will fully support the Windows Vista UAC

    Improved consistency for child in-context references when renaming a parent assembly document

    DBWorks can now correctly rename references in features of sub-assembly, features which refer planes or other features of the parent assembly being renamed.

    New sub-option: Environment→Use SolidWorks Materials→Apply the material to all the configurations

    When checked, DBWorks will apply the new material (selected through the DBWorks Material Editor) to each configuration. DBWorks will also coherently update the Custom Properties for each configuration.

    The option emulates the behavior of the following SolidWorks Edit Material Property Manager option:

    Improved message displayed when references are not found

    The list of the missing references is now displayed when opening an assembly containing one or more missing references:

    SolidWorks@ConfigurationProperty@... parameters accepted from the Dataentr.LST script

    The Dataentr.LST script (Save Wizard) can now output, if needed, the following parameters:

    SolidWorks@ConfigurationProperty@Name
    SolidWorks@ConfigurationProperty@Description
    SolidWorks@ConfigurationProperty@Comment
    SolidWorks@ConfigurationProperty@AlternateName

    DBWorks will apply the corresponding parameter to the current configuration of the current model being saved.
    Example
    Dataentr.LST
    Sub main()
    	…
    	…
    	DBWOutput "SolidWorks@ConfigurationProperty@Name","MyNewCfgName",ForAppending
    	…
    End sub

    The current configuration will be renamed as

    Summary Info properties imported through the CustProp.txt

    The Summary Info properties can now be imported by declaring the following identifiers in the CustProp.txt ( or CustProp_Insert.txt ) file:

    "SW_Title"
    "SW_Subject"
    "SW_Author"
    "SW_KeyWords"
    "SW_Comment"
    "SW_SavedBy"
    "SW_CreateDate"
    "SW_SaveDate"

    Example

    CustProp.txt

    DESCRIPTION	"SW_Title"
    NOTES		"SW_Comment"

    New sub-option: Track only out-of-context 'base part→derived part' relations

    If checked, DBWorks will not track any in-assembly-context part-to-part relation, tracking only the base part->derived part relations.
    A positive performance issue is that when enabling this sub-option, DBWorks will avoid to resolve the light-weight components on save.

    New sub-option: Always use DBWorks 'Save' and 'Save as…→ Enable SHIFT key for launching native CAD 'Save As...'

    When checked, if the Shift key is pressed while pressing the DBWorks Save As toolbar button, then the native SolidWorks File→Save As… dialog will be displayed, so allowing the export of the file in different formats.

    Improved support for Toolbox

    A new option Environment→ Use 'DataEntr.LST' on Toolbox Components is available for controlling that, when a Toolbox component is dropped into an assembly, DBWorks will call the Dataentr.LST (Save Wizard) script, passing @CONTEXT=GET_FILENAME_BEFORE_DROP as context.
    The original Toolbox file name is passed with the @DOCUMENT_FNAME and @DOCUMENT_FDIR parameters.
    Being the drop action a critical phase, when invoked with @CONTEXT=GET_FILENAME_BEFORE_DROP, the Dataentr.LST can not display any user interface element, like forms, message boxes, etc. else SW will hang

    tree

    Documents locked by other users functionality available in the Tree Page

    The Documents locked by other users functionality is now available also in the Tree Page:

    Please look at the Behavior Changes section for the changes applied to the List Locked Files functionality.

    Options for disabling grids active also in the Tree Page

    The following options:

    User Interface→Browser Behavior→Disable Assembly grid
    User Interface→Browser Behavior→Disable Parts grid
    User Interface→Browser Behavior→Disable Drawings grid
    User Interface→Browser Behavior→Disable Generic Document's grid

    controls now the existance of the Assembly, Part, Drawing and Other Documents tabs in the Tree Page’s Grids area

    Configurations tab in the Tree Page

    A new tab named Configurations shows all the configured distinct records of the currently selected document:

    The list of displayed fields is dynamically exchanged between the list for the Part type documents and the Assembly type documents, depending from the currently selected document type.

    Custom Query tabs in the Tree Page

    It is now possible to display custom query tabs in the Tree Page.

    DBWorks will display as many tabs as the number of scripts .LST with the prefix OnCustomQueryTab_

    Each script must return the output parameter @QUERY containing the query to be displayed in the Tree Page Tab.

    Example

    Suppose we want to show quickly the parts that have a LENGTH similar to the selected part.

    We will create a script named OnCustomQueryTab_SimilarLength.LST in the shared LST directory, as follows:

    .VBSCRIPT
    sub main()
    	DBWInit(TRUE)
    	uid = DBWInput("@DOCUMENT_UNIQUE_ID")
    	if uid = 0 then
    		exit sub
    	end if
    	length = DBWQueryByUId( uid, DBWLookUp("NAME_FIELD_LENGTH") )
    	if length = 0 then
    		exit sub
    	end if
    	lengthMax = length * 1.1
    	lengthMin = length * 0.9
    	query = _
    		"SELECT "&_
    			DBWLookUp("NAME_FIELD_T") & "," &_
    			DBWLookUp("NAME_FIELD_ID") & "," &_
    			DBWLookUp("NAME_FIELD_LENGTH") &_
    			",*" &_
    		"FROM " &_
    			DBWLookUp("NAME_DOCUMENT_TABLE") &_
    		" WHERE " &_
    			DBWLookUp("NAME_FIELD_LENGTH") & ">=" & lengthMin &_
    		" AND " &_
    			DBWLookUp("NAME_FIELD_LENGTH") & "<=" & lengthMax &_
    		";"
    	' return the query to DBWorks
    	DBWOutput "@QUERY",query,ForWriting
    end sub

    The result in the Tree Page will be the display of a new tab named SimilarLength:

    Better visualization of existing drawings

    The "x" of the existing drawings column has been replaced with a drawing icon:

    Improved Find a Document … functionality on closed Projects

    The RMB→Find a Document … functionality works now also on Projects kepts closed for performance issues.

    DBWorks checks if the document to be searched is between the children of the selected project and expands it only when needed.

    New sub-option Enable drag-and-drop on Assemblies→Only for fake components

    User Interface→Tree→Enable drag-and-drop in Trees
    User Interface→Tree→Enable drag-and-drop on Assemblies
    User Interface→Tree→Only for fake components

    The new sub-option allows the drag&drop of components into existing assemblies only if the components have been created with the Create New Bom Item functionality (fake components).

    user interface

    User Interface Style

    A new set of options is available in the User section of the Options:

    The options change the global User Interface style for the current user.

    A new sub-folder named Styles, located under the SCHEMA\IMG folder, contains the available style files.

    The style named MechWorksStyle.Default is the one used by DBWArm and other applications with no Users parameters.

    Automatic Login in the Support Area of www.mechworks.com

    A Login button has been added to the About … form to automatically log into the support area of www.mechworks.com

    Improved display of Checked-out-by-others, Not-revision-managed, Standard-part attribute

    The display of the Checked-out-by-others, Not-revision-managed, Standard-part attribute has been enhanced.

    Generic Documents are now always displayed with the correct type icon independently of the above attributes state.

    Hot-keys file

    It is now possible to define some hot-keys through the definition file SCHEMA\DBWHOTKEYS.TXT, or, in it’s user specific version, USERS\<user name>\DBWHOTKEYS.USR.
    Both files are managed by DBCustomizer.

    ;===================================================================
    ;
    ; DBWorks2007(C)MechWorks Hot-keys definition file
    ;
    ; Format:
    ;
    ; HOT-KEY-ID	<DBWShell command> | <@SpecialCommand>
    ;
    ; Where:
    ; HOT-KEY-ID	F1|F2|F3|...|F12|0|1|2|...|9|A|B|C|...|Z
    ;
    ; HOT-KEY-ID can be prefixed by CTRL- or SHIFT- for applying the hot-key
    ; only when the CTRL or SHIFT keys are pressed
    ;
    ; The allowed special commands are:
    ; @SEARCH	move the input focus in the [SEARCH] edit box
    ;
    ;===================================================================
    CTRL-A		Checkout
    SHIFT-A		Checkin
    F5		Requery
    CTRL-Q		@SEARCH
    CTRL-B		ExecScript CalledFromHotKey.vbs
    

    No limits on Ctrl+C (Copy) for Grids

    It has been removed the limitation on max 700 rows to be copied in the clipboard. The Ctrl+C can copy an entire large grid, and the result is available for pasting into MS Excel or any other Windows application.

    Improved Delete/Plot dialog

    The standard Delete/Plot confirmation dialog, used when deleting or plotting a set of documents, has been enhanced so to display the full state of the documents and to display the enhanced tooltips. The enhanced tooltips feature is controlled by the option
    Users→Show Enhanced Tooltips in Delete/Plot Dialog Grid

    Improved Document Selector dialog

    • In the Document Selector dialog it is now possible to select the column’s headers of both the Prev.Rev. and the Script columns, and have all the rows be affected by the selection change:
    • In the Multiple Checkin/Approve operations, any check-box activated in the Document Selector dialog is correctly restored after the check for not null fields ( with or without any consequent multiple editing for filling the null fields )

    Do not show this message again check-box

    The following message boxes have been enhanced for supporting the “[X] Do not show this message again” check-box:

    • multiple document selection
    • current project
    • add all documents to a project

    variant notes

    $FIRSTREV(FieldName) macro

    The new macro returns the value of the assigned REVISIONS field in the 1st revision of the document.

    visual cues

    Multiple Visual Cues Definition files

    DBWorks 2007 supports now multiple Visual Cues Definition files.
    The purpose is to allow the user to display sets of Visual Cues, depending from specific conditions he likes to highlight.

    The application looks in the SCHEMA\IMG directory for files with the naming convention: DBWVisualCuesDefinition_*.txt

    The available file suffixes are listed in the Options→User Options tab:

    allowing the user to select the desired Visual Cues definition file.

    Once selected, DBWorks will reload the Visual Cues definitions, so dynamically changing the current Visual Cues visualization.

    Example

    Selecting OutOfStock, only the items that satisfies the DBWVisualCuesDef_OutOfStock.txt definitions will be displayed with a Visual Cue:

    Selecting Recommended, only the items that satisfies the DBWVisualCuesDef_Recommended.txt definitions will be displayed with a Visual Cue:

    Right-aligned visual cues

    The new position code 3 can be assigned to a Visual Cue, allowing the Visual Cue to be right-aligned. The <Tree Img Offset> and <Grid Img Offset> parameters must be negative.

    Example
    ;--------------------------------------------------------------
    ; DBWVisualCuesDef.txt
    ;
    ; DBWorks Visual Cues Definition File
    ;
    ;--------------------------------------------------------------
    ; "<field name>","<field value pattern>","<Image Definition>",<Img width>,<Position Code>,<Tree Img Offset>,<Grid Img Offset>
    ;
    ; <Image definition>::=
    ;		a .BMP/.JPG/.TIF/.PCX/.TGA file name, or …
    ;		@Line,<pen width>,R,G,B
    ;		@Cross,<pen width>,R,G,B
    ;		@Rectangle,<pen width>,R,G,B
    ;		@Ellipse,<pen width>,R,G,B
    ;
    ; <Position Code>	0: full row; 1:icon; 2: text; 3: right-side full row
    ;
    "T","A","dbwscbar149.bmp",18,3,-24,-24
    

    workflow

    New parameter @SILENT passed to the OnGetWorkflowProcess.LST

    The new parameter @SILENT (value [0/1]) is passed to the OnGetWorkflowProcess.LST

    The parameter is 1 when DBWorks requests to return the process without any user interaction.

    Example of OnWorkflowStateHasChanged.LST

    The following is an example of the script OnWorkflowStateHasChanged.LST, adapted for sending a notification e-mail to all the users that have the EMAIL field not null in the DBWORKS_USERS table.

     .VBSCRIPT
    
    const temporaryZipAttachmentFileName = "C:\temp\attachment.zip"
    
    sub main
    	DBWInit(TRUE)
    
    	silent = DBWInput("@SILENT")
    	ecoId = DBWInput("@ECO_ID")
    	process = DBWInput("@PROCESS")
    	fromState = DBWInput("@FROM_STATE")
    	toState = DBWInput("@TO_STATE")
    	docUid = DBWInput("@DOCUMENT_UNIQUE_ID")
    	allOk = DBWInput("@ALL_OK")
    
    	DBWShell("WorkflowGetNotesAndFileAttachment " & docUid )
    	notes = DBWResult("@WORKFLOW_NOTES")
    	attachment = DBWResult("@WORKFLOW_ATTACHMENT")
    
    	id = DBWQueryByUid( docUid, DBWLookUp("NAME_FIELD_ID") )
    	user = DBWGetOption("USER_NAME")
    
    	ReDim Preserve userList(1)
    	DBWorkflowGetUserList toState,userList
    	for j=0 to ubound(userList)-1 step 4
    		userId		= userList(j)
    		fullName	= userList(j+1)
    		phone		= userList(j+2)
    		email		= userList(j+3)
    
    		nameToAddress = userId & "@" & DBWGetOption("COMPANY_ID")
    
    		if DBWGetOption("DBWARM_USER") <> userId then
    			sendNotificationEmail nameToAddress,id,fromState,toState,user,attachment
    		end if
    	next
    
    end sub
    
    sub sendNotificationEmail( nameToAddress, id, fromState, toState, user, attachment )
    	SUBJECT		= "Workflow notification: " & id & " - state changed to """ & toState & """"
    	BODY_HTML01		= "<html><body>"
    	BODY_HTML02		= "<h1 align=""center""><FONT face=""Verdana"" size=""5"">DBWorks Workflow Notification</FONT></h1>"
    	BODY_HTML03		= "</br>"
    	BODY_HTML04		= "Document"
    	BODY_HTML05		= "<h0 align=""center""><FONT face=""Arial black"" size=""3"">" & id & "</FONT></h0>"
    	BODY_HTML06		= "</br>"
    	BODY_HTML07		= "has changed state from"
    	BODY_HTML08		= "<h0 align=""center""><FONT face=""Arial black"" size=""3"">" & fromState & "</FONT></h0>"
    	BODY_HTML09		= "to"
    	BODY_HTML10		= "<h0 align=""center""><FONT face=""Arial black"" size=""3"">" & toState & "</FONT></h0>"
    	BODY_HTML11		= "</br>"
    	BODY_HTML12		= "</br>"
    	BODY_HTML13		= "Sent by " & user & ", " & Date() & "</br>"
    	BODY_HTML14		= "</br>"
    	BODY_HTML15		= "</body></html>"
    	if attachment<>"" then
    		DBWShell("FileZip New " & replace(temporaryZipAttachmentFileName," ","|"))
    		DBWShell("FileZip Add " & replace(attachment," ","|"))
    		DBWShell("FileZip Create")
    		ATTACHMENT01 = temporaryZipAttachmentFileName
    	end if
    
    	DBWShell("EMail New Notification "		& nameToAddress )
    	DBWShell("EMail Data SUBJECT "		& replace(SUBJECT," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML01," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML02," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML03," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML04," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML05," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML06," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML07," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML08," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML09," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML10," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML11," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML12," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML13," ","|"))
    	DBWShell("EMail Data BODY_HTML "		& replace(BODY_HTML14," ","|"))
    	DBWShell("EMail Data ATTACHMENT "		& replace(ATTACHMENT01," ","|"))
    	DBWShell("SendEMail")
    
    end sub
    

    Other Applications

    Wizards

    Assembly Duplication Wizard: Duplication As-Built

    DBWorks ADW 2007 introduces a support for duplicating a snapshot of the current status of an assembly. The assembly file names are generated with a time stamp and current revision info. The assembly snapshot can be registered in the database or attached to the original document with the new DBW_ATTACHMENTS managed by DBWorks.

    A new page in the options defines the settings for the As-Built duplication.

    When registering As-Built assemblys they will be located in the As_Built project (auto-created) under a sub-project named as the sub-assembly.

    When registering As-Built assemblys as attachments they will be located in Attachments tab.

    Conversion Wizard

    The custom query will now define the documents that MUST be converted.

    A new option for defining the load on different workstations has been added .

    When the option is set the Conversion Wizard will create a file with the a number of queries to be loaded on, as custom query ,on each workstation. The file will be opened in notepad after confirming the Conversion Wizard dialog.

    PDMWorks Import Wizard

    This Wizard allows to import documents, properties and revisions from an existing PDMWorks for Worgroup installation.

    The tool requires DBWorks StandAlone 2007 and a SolidWorks 2007 or better.

    When you start the Wizard, you need to log into PDMWorks from within the wizard.

    Then you must select the projects to import. If you have a large number of documents importing the projects in separate batches can be a good idea.

    After selecting the project you are presented with the list of properties and configurations. Here you must select the properties you want to import and associate them with the fields of the DBWorks records. If needed you can create new fields to store the information coming from the custom properties of the files.

    If you import the configurations (DBWorks will treat each configuration as a separate record) you can select a set of configurations to import or to ignore.

    In the final tab you start the migration.

    During the migration the files are first extracted to a selected path and grouped in sub folders, then registered one by one.

    It is possibe to use both SolidWorks or DBWorks Stand Alone to register the files, but DBWorks Stand Alone is generally faster.

    Other topics

    DBCustomizer

    • Support for sort order of browser tables in DBCustomizer 5.2.5
    • More info in the updates suggested: type and size of field to be added indicated explicitly
    • Support for Linked Tables

      Linked Tables can be managed from DBCustomizer selecting the entry Customize, Linked Tables

      The interface allows you to specify that a field in the DOCUMENT table is used as a key to link an external table as an extension of the DOCUMENT table:

      How to add a link:

      1. click the button just below the header
      2. select the table
      3. select the field inside the table
      4. select the linked field in the DOCUMENT table

      Automatic behaviors in the interface to simplify the task:

      • When you select a different table the list of fields on the right is filled automatically, the Primary Key, if available is selected. If the primary key includes more fields, the first is selected.
      • When you select a different field in the external table if the field is of type test the field ID is selected automatically as the foreign key in the DOCUMENT table; if, on the other hand the field is numeric the field UNIQUE_ID is selected as the foreign key in the DOCUMENT table.
      • You can change the selection for the DOCUMENT field used as the foreign key manually.

    • Support for Custom Fields in every table. Support for the protection of basic fields in REVISIONS and PARENT_CHILD.
    • Adding a field with the name of an existing text one and with different size changes the field size in the database
    • In the Manager for the Shortcut Bar it is now possible to set icons up to an index of 250 (previously it was 150). The naming convention and file location of the bitmaps is left unchanged.

    Visual Cues Manager

    • Support for open/save as with filter on files, icons added to the toolbar
    • DBWJComp.dll includes the old VisualCuesManager.dll, now obsolete
    • Support for SQL conditions on any database table

    Excel BOM

    • Added ability to filter out models that have a drawing
      • The interface in the designer has slightly changed, passing from a check to a list

      • The parameter that can be added to the files PAR\DBWBOM_* is FILTER_OUT_DOCS_WITH_DRAWING
    • The Excel BOM Designer controls the validity of the field names for the DOCUMENT table
    • Added new option to exclude Generic Documents from the BOM, made independent from part-part relations management
    • Reordering is now managed in case of first level duplicates for BOMs of projects
    • Options first residing in the DATAENTR>LST have been exposed in the Options dialog of Category Maker
    • Excel BOM supports the Linked Tables
    • Support for the display of only one item when there are several parents
    • Support for custom PARENT_CHILD fields. The fields are available in the EXCEL BOM Designer for the BOM items but not in the header.
    • Support for REVISIONS in the BOM engine contained in the object MWScriptGui.BOM .

      The scripts in the ExcelBOM.lib library had to be updated to include the new function
      ExcelBOMRevision(uid, revision)

      Another function has been added to avoid lack of generality:
      Function ExcelBOM3(uid, par_file, excel_file_name,revision)
      where the last parameter should be an empty string for the current revision and the revision for which the BOM is requested otherwise.

      Also the function BOMRecordset in the object MWSCriptGui.BOM now has an added optional parameter for the revision name and it returns a recordset with the current BOM if the revision is a null string and the BOM for the requested revision otherwise. All changes are backwards compatible. Note that for previous revisions you cannot obtain information about the parents of the items, namely projects and drawings because such information would not be accurate.

    Category Maker

    • Behavior change: eliminated the restriction that would keep categories from indicating a sub-path instead of a simple category name
    • In Save Wizard missing metacategories are created on the fly instead of displaying an error message
    • Support for ‘.’ As a sub-codes separator
    • The label of the button to close the application has been changed to ‘Exit’ for the sake of clarity

    Workflow Viewer

    • Clicking other documents in the same ECO updates the preview panel

    Advanced Filter

    • Eliminated duplicate entries in the values displayed for date fields. Equals still doesn’t apply to date/time fields as they are expressed in milliseconds.
    • The parameter file SCHEMA\AdvFilterFields.txt controls the list of fields that appear in the leftmost combo box of custom conditions in the Advanced Filter. The parameter file is a simple list of the fields with the same name that they have in the DOCUMENT table of the database. The parameter file must contain at least one valid field name. The entry ‘anywhere’ remains always visible. A valid example of file content is the following:
      ID
      FILE_NAME
      FILE_DIRECTORY
      DESCRIPTION

      The usual editing rules for comments apply to this parameter file; there currently is no GUI editing tool for this file.

    WebClient

    A new version of WebClient will be released shortly after the release of DBWorks/DBInventor 2007

     

    Behavior Changes

    Briefcase

    A main database of type MDB is no more supported for the Briefcase functionality

    CAD Specific Issues

    • The dialog box, displayed when detaching DBWorks as an add-in of SW, asking for the reset of the original SW settings, is no more displayed, being managed automatically
    • If the Save Wizard is active (Options Open/Save→Save As→Use Dataentr.LST ), when working with the configurations activated, for weldment parts, if the active configuration is the <As Welded>, DBWorks activates the parent <As Machined> configuration, for avoiding rename conflicts (generating SW errors) when the derived <As Welded> configuration is renamed before the <As Machined>

    Documents locked by other users

    The Documents locked by other users functionality has been changed as follows:
    1. The functionality expects a selection; it no more works on the whole grid result set
    2. The functionality works also from the Tree Page
    3. The functionality creates a temporary user table named DBW_LOCKED_FILES_<user name>; the global DBW_LOCKED_FILES table is no more used
    4. The DBW_LOCKED_FILES_<user name> table has the following structure:
      T			VARCHAR(1)
      ID			VARCHAR(256)
      USERID			VARCHAR(256)
      SERVER			VARCHAR(256)
      DESCRIPTION		VARCHAR(512)
      FILE_DIRECTORY		VARCHAR(256)
      FILE_NAME		VARCHAR(256)
      STATE			VARCHAR(40)
      CONFIGURATION		VARCHAR(256)
      REVISION		VARCHAR(40)
      COMPANY_ID		VARCHAR(256)
      OWNER_COMPANY_ID	VARCHAR(256)
      CHECK_OUT_BY		VARCHAR(256)
      UNIQUE_ID		INTEGER

    DWGViewer

    The BIN\DWGView.EXE is obsolete and it has been removed;
    consequently, the RMB→Preview of …DWG functionality, uses now the new DWG viewer

    Link Mode

    Even if the option Open→Don't open related documents on checkout is unchecked, any linked Generic Document is no more automatically opened by DBWorks

    Old Excel-based BOM no more available

    DBWExcel Data Source no more used

    DBWBOM Data Source no more used

    Options

    Options Renamed

    Revisions→Approval→Update Variant Notes on Revision approval
    has been renamed as
    Revisions→Approval→ Update Drawings on revision approval

    Options Removed

    Revisions→Approval→Automatic parent's bitmap refresh on revisions approval