# load obj file with Vtkobjreader giving relative path

**URL:** https://discourse.vtk.org/t/load-obj-file-with-vtkobjreader-giving-relative-path/6032
**Category:** Support
**Created:** [June 21, 2021, 6:19pm UTC](https://discourse.vtk.org/t/load-obj-file-with-vtkobjreader-giving-relative-path/6032 "2021-06-21T18:19:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Raj\_Kumar\_Ranabhat](https://discourse.vtk.org/user_avatar/discourse.vtk.org/raj_kumar_ranabhat/32/3584_2.png) [@Raj\_Kumar\_Ranabhat](https://discourse.vtk.org/u/Raj_Kumar_Ranabhat)
#### Post date: [June 21, 2021, 6:19pm UTC](https://discourse.vtk.org/t/load-obj-file-with-vtkobjreader-giving-relative-path/6032/1 "2021-06-21T18:19:08Z")

</div>

Hi ,

I was trying to load obj file using VtkobjectReader in C++  
While loading a obj with SetFileName if I give a full path of the obj, it works. However, I would like to load that file with relative path because I am in debug mode of 3D slicer. Any suggestions ?

Thank you !!

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [June 23, 2021, 5:29am UTC](https://discourse.vtk.org/t/load-obj-file-with-vtkobjreader-giving-relative-path/6032/2 "2021-06-23T05:29:20Z")

</div>

You can use relative path in a small command-line application, but in a large GUI application many components may change the current working directory, therefore I would always recommend to use absolute paths. If you know what is the working directory then you can easily convert relative paths to absolute paths and pass that to 3D Slicer or VTK.
