Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are two options to open a file. Either you can open it through an API server or directly from hard disk.

Supported file formats: dwg, dwt, dxf (up to 2018)

Open file from hard disk

To open a file with editor you have to , simply pass the file path including file protocol prefix in the fileUrl query parameter to the editor url.Like this. The format follows the file URI scheme “file:///path”.

The url to open a drawing depends on which port and path you selected during server install:

http://localhost:8081/editor:{http-port}{deploy-path}?fileUrl=…

e.g. for port 80 and deploy path /
Linux: http://localhost/?fileUrl=file:////home/andrea/Documents/My%20Drawings/test.dwg

Please note that only view-only mode is supported when opening file from disk. It is required to open a file through API server if you want to open it in editing mode.

Open file through API server

First you need to run an API server. There is a simple API server that implements all required REST APIs used by editor application to open and save files. It is located in installation directory besides Kudo folder in API_server.

Before you setup API server, you need to install nodejs (https://nodejs.org/en/download/)

Now you can run API server:

  1. Open command line and go to /opt/graebert-gmbh/Kudo-Server/API_server

  2. Run “sudo npm install” to install server

  3. Run “node bin/www” to run server

API server now runs on port 3000. See next section how to open a files with editor.

To open a file with editor you have to pass API server and file to editor url.

Required parameters are:

  • server - specifies the API server url what is http://localhost:3000 for above installed API server

  • file - path of the drawing file you want to open

  • access - mode you want to open the file in. Accepted values “edit” for editing and “view” for view mode. If not passed, edit mode is used

So url to open a drawing should be like:

Editor:

Windows: http://localhost/?fileUrl=file:///c:\Users\hentschke\Documents\My%20Drawings\test.dwg

or for port 8081 and deploy path /editor
Linux: http://localhost:8081/editor?serverfileUrl=httpfile://localhost:3000&file=/home/andrea/Documents/My%20Drawings/test.dwg
ViewerWindows: http://localhost:8081/editor?serverfileUrl=httpfile:///localhost:3000&file=/home/andrea/Documents/My%20Drawings/test.dwg&access=viewc:\Users\hentschke\Documents\My%20Drawings\test.dwg

Please note that only view-only mode is supported when opening file from disk. It is required to open a file through API server if you want to open it in editing mode.

Open file through API server

See https://graebert.atlassian.net/l/cp/tx0FyeGA