I found How to link to external files with relative path in QGIS actions? , which leads me towards what I need.

Now, I'm trying to use the eVis plugin to open .DWG and .DXF by launching AutoCAD from the Event Browser. I've tried to configure the external application as shown in my screen capture. The file name is now highlighted in green under the Display tab, but nothing happens when I double click on the file pathname. I'm using relative paths. I've tried modifying the extension to not include the '.' and it doesn't work either. There are issues with opening the pdfs in Foxit as well.

Configure External Applications eVis

  • 1
    Have you checked this related question about opening files in external applications gis.stackexchange.com/questions/88593/…
    – underdark
    Mar 19, 2014 at 19:26
  • Yes, and the action tool is great. However, i am using eVis because it allows me to supply relative pathnames, which is important.
    – user25976
    Mar 19, 2014 at 19:50

2 Answers 2


I don't have AutoCAD installed but I use DWG TrueView instead, without any problems.

Below is the Event Browser configuration:

enter image description here

Normally I don't use relative paths (I use an URL instead) but for this example I've made the necessary modifications:

enter image description here

enter image description here

All you have to do now is to double click the green line and your drawing will be displayed as expected:

enter image description here

Now, as everything is working ok, I want to give you, supplementary, some hints about the eVis configurations:

  • on different sites/forums you'll see a lot of advices about the base path and how to store your file name in the database (with or without a trailing/leading slash/backslash).
  • I'm pretty sure that everyone has a working solution but, if you have any doubts with the eVis configuration, just remember you can easily identify what's happening, with the help of a process explorer utility.
  • just take a look at the TrueView starting line, to see how it looks after all the configuration you made: enter image description here

This is the (red circled) proper start line:

"C:\Program Files\Autodesk\DWG TrueView 2014\dwgviewr.exe"  c:\temp\1\street.dwg

Any configuration you made, will be shown here, for you to examine it, and to understand why something doesn't start, as expected.


Thanks to this forum post, I've now learned how to use relative paths using a QGIS Python Action: http://osgeo-org.1560.x6.nabble.com/QGIS-Actions-and-relative-path-td4131267.html

from os import startfile; proj = QgsProject.instance(); UriFile = str(proj.fileName()); img = '%RelativePath'; Path = str(os.path.dirname(UriFile)); startfile(Path+img); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.