|
<< Click to Display Table of Contents >> Navigation: CAD/Application Integrations > SolidWorks addin > Sheet names support |
The following feauture is available only starting from SolidWorks 2009 sp3.
It is possible, from the TreePage, to preview/open a specific Sheet of the currently selected Drawing.
At drawing save/refresh time, DBWorks keeps updated a table named DBW_DRAWING_SHEETS.
If the Drawing has still not be saved/refreshed at least one time, the table records are automatically created when selecting the drawing in the Tree Page.

It's required a field name in the file DBFields.MSG
NAME_FIELD_SHEET_NAME "SHEET_NAME"
localized for each language.
It's required a table named DBW_DRAWING_SHEETS

the fields are localized as
NAME_FIELD_DOCUMENT_UNIQUE_ID
NAME_FIELD_SHEET_NAME
in the different LANG\<language>\DBFields.MSG files.
More, an index must be declared on the field DOCUMENT_UNIQUE_ID:

For each language it must exist a custom query tab script as follows:
•English → LST\OnCustomQueryTab_Sheets.LST
•Italian → LST\OnCustomQueryTab_Fogli.LST
•French → LST\OnCustomQueryTab_Feuilles.LST
•German → LST\OnCustomQueryTab_Blätter.LST
•Spanish → LST\OnCustomQueryTab_Hojas.LST
The content of the files is the same for all language, like follows:
.VBSCRIPT
sub main()
DBWInit(TRUE)
' the parent document unique id
documentUniqueId = DBWInput("@DOCUMENT_UNIQUE_ID")
if documentUniqueId = 0 then
exit sub
end if
nameDocumentTable = DBWLookUp("NAME_DOCUMENT_TABLE")
nameDrawingSheetsTable = "DBW_DRAWING_SHEETS"
nameFieldT = DBWLookUp("NAME_FIELD_T")
nameFieldID = DBWLookUp("NAME_FIELD_ID")
nameFieldUNIQUE_ID = DBWLookUp("NAME_FIELD_UNIQUE_ID")
nameFieldDOCUMENT_UNIQUE_ID = DBWLookUp("NAME_FIELD_DOCUMENT_UNIQUE_ID")
nameFieldSHEET_NAME = DBWLookUp("NAME_FIELD_SHEET_NAME")
' build the tab query
query =_
"SELECT " &_
nameDocumentTable & "." & nameFieldT & " AS " & nameFieldT & "," &_
nameDocumentTable & "." & nameFieldID & " AS " & nameFieldID & "," &_
nameDrawingSheetsTable & "." & nameFieldSHEET_NAME & " AS " & nameFieldSHEET_NAME & "," &_
nameDrawingSheetsTable & "." & nameFieldDOCUMENT_UNIQUE_ID & " AS " & nameFieldDOCUMENT_UNIQUE_ID & " " &_
"FROM " &_
nameDrawingSheetsTable & "," & nameDocumentTable & " " &_
"WHERE " &_
nameDrawingSheetsTable & "." & nameFieldDOCUMENT_UNIQUE_ID & "=" & nameDocumentTable & "." & nameFieldUNIQUE_ID & " " &_
"AND " & nameDrawingSheetsTable & "." & nameFieldDOCUMENT_UNIQUE_ID & "=" & documentUniqueId & " " &_
"ORDER BY " & nameDrawingSheetsTable & "." & nameFieldSHEET_NAME
' return the query to DBWorks
DBWOutput "@QUERY",query,ForWriting
end sub