Configuring CADViewer
CADViewer is a third-party product which can be integrated into OpenKM to provide previsualization of AutoCAD documents.
The required execubles should be already included in your OpenKM installation. Please, check if the $TOMCAT_HOME/bin/cadviewer folder exists and contains executable files like autoxchange and dwglist, among others.
Go to Administration > Utilities > Database query. At bottom right select option JDBC, paste into the box the SQL insert:
INSERT INTO OKM_EXTENSION (EXT_UUID, EXT_NAME) VALUES ('8e642680-0dcd-4ded-a501-2aa3e53b1286','CADViewer Preview');
Some configuration properties are needed:
Field / Property | Type | Description |
---|---|---|
extension.cadviewer.license.key | String |
The CADViewer frontend key. The default license only work with local installations. Is the javascript CAD previewer. |
extension.cadviewer.autoxchange | String |
Path to autoxchange utility. Used in thumbnail generation, preview and PDF conversion. |
extension.cadviewer.linklist | String |
Path to linklist utility. Extract text and metadata from DWG documents. |
extension.cadviewer.dwglist | String |
Path to dwglist utility. Get XREFs from DWG documents. Also used in thumbnail, preview and PDF conversion. |
extension.cadviewer.sibling.xrefs | Boolean |
When this parameter is set to true the AutoCAD files's references have to be all in the same folder. If it is set to false the AutoCAD files's references can be stored in any place in the taxomony tree. In this case, keep on mind that you should avoid document name duplication. There is an automation called CheckUniqueDocumentName which can help you to maintain this restriction. |
extension.cadviewer.debug | Boolean |
Set to true to view the commands executed to conversion in the log file. Only for debug purpose. |
extension.cadviewer.remove.temp.files | Boolean |
Set to false to keep the temporary files creating during conversion. Only for debug purpose. |
extension.cadviewer.qr.url | String | The URL of the QR code application: http://openkm.your-domain.com/qrcad/ |
extension.cadviewer.qr.user | String | Name of the user of the QR code application. |
extension.cadviewer.qr.password | Password | The password of the user of the QR code application. |
extension.cadviewer.qr.pos_x | Integer | Percent X from the lower-left where to put the QR code in the AutoCAD file. |
extension.cadviewer.qr.pos_y | Integer | Percent Y from the lower-left where to put the QR code in the AutoCAD file. |
extension.cadviewer.qr.width | Integer | QR code width percent. |
These utilities can be downloaded from https://cadviewer.com/alldownloads/
CADViewer has several licenses:
- axlic.key: This is the license for the autoxchange executable. This one should be placed in the same directory of the executable, typically located at $TOMCAT_HOME/bin/cadviewer folder.
- dl_lic.key: This is the license for the dwglist executable. This one should be placed in the same directory of the executable, typically located at $TOMCAT_HOME/bin/cadviewer folder.
- dm_lic.key: This is the license for the dwgmerge executable. This one should be placed in the same directory of the executable, typically located at $TOMCAT_HOME/bin/cadviewer folder.
- ll_lic.key: This is the license for the linklist executable. This one should be placed in the same directory of the executable, typically located at $TOMCAT_HOME/bin/cadviewer folder.
- Javascript CAD previewer license: This license key is configured using the extension.cadviewer.license.key configuration property.
If you have problems with the conversion, try to execute from the command line. For example, this would make a PDF conversion:
$ ./autoxchange -i=test.dwg -f=pdf
In case of Linux, ensure you have configured the LD_LIBRARY_PATH properly. In case of Windows the program may fail because VCRUNTIME140.DLL is missing. If you see this error, download the Microsoft Visual C++ 2015 Redistributable from https://www.microsoft.com/en-us/download/details.aspx?id=52685 and install it.
There is also an script which may help because set the right libraries path:
$ ./cad2svg test.dwg
The resulting "test.svg" file can be viewed with any browser and you will see if the license was setup correctly.
To enable this extension go to Administration > Utilities > Database query. At bottom right select option JDBC, paste into the box the SQL insert:
INSERT INTO OKM_EXTENSION (EXT_UUID, EXT_NAME) VALUES ('38a9d032-30b9-470d-93ad-47f5e4f93f97', 'External Tab Document');
Configuring Automations:
Name | Event | At | Validations | Actions |
---|---|---|---|---|
CAD Create | Document create |
post |
Type: NameMatches |
Type: NewCadReferences |
CAD Update Pre | Document update | pre | Type: NameMatches Param 0: .+\.[dD][wW][gG] |
Type: DelCadReferences Order: 0 |
CAD Update Post | Document update | post | Type: NameMatches Param 0: .+\.[dD][wW][gG] |
Type: NewCadReferences Order: 0 |
CAD Delete | Document delete | pre |
Type: NameMatches |
Type: DelCadReferences Order: 0 |
CAD Folder Delete | Folder delete | pre |
Type: PathContains |
Type: DelCadReferences |
In case of using old UI you need to use an extension, but keep on mind this will be unsupported soon.
To view external references for each AutoCAD document must set the value of the configuration key extension.external.tab.document. For do it, go to Administration > Configuration and set the appropiate value for this key:
extension.external.tab.document = References;/openkm/frontend/XRefs
You can use this SQL sentence to set the configuration property. Go to Administration > Utilities > Database query and execute:
INSERT INTO OKM_CONFIG (CFG_KEY, CFG_TYPE, CFG_VALUE) VALUES ('extension.external.tab.document', 'list', 'References;/openkm/frontend/XRefs');
Troubleshooting
Mainly there are two license problems: one related to the browser client side license, and the other related to the server side conversion utilities.
Client side (browser)
These problems are related to the CADViewer Javascripr previewer. The license set in extension.cadviewer.license.key configuration property is wrong.
You can identity this issue by the "CADViewer Trial Version" watermark.
To solve this issue set the right key in the extension.cadviewer.license.key configuration property and refresh the browser.
Server side (utilities)
These problems are generated by CADViewer conversion utilities installed in the server. This license is configured in the axlic.key server file.
You can identify this issue by the "For Demonstration Purposes / Tailor Made Software" watermark.
To solve this issue copy the right axlic.key license file to the OpenKM server. Once copied, please go to Administration > Utilities > Clean Conversion Cache and clean the SVG cache.
You can verify the license this way:
$ ax2023 -verify
This parameter is only available in a recent AutoXchange version.