Include / Use search path

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Include / Use search path

James Day
Hi,

Trivial question from a new user.

How can you specifiy the search path for include files in OpenSCAD (for Windows) - I can't find this documented anywhere.

I'm using the latest build..


Thanks,

James Day


Reply | Threaded
Open this post in threaded view
|

Re: Include / Use search path

Triffid Hunter
On Wed, Jan 4, 2012 at 8:28 PM, James Day <[hidden email]> wrote:
> Hi,
>
> Trivial question from a new user.
>
> How can you specifiy the search path for include files in OpenSCAD (for
> Windows) - I can't find this documented anywhere.
>
> I'm using the latest build..

as far as I know it searches the current working directory, ie if you
opened a scad file, the directory that the file is in, otherwise
whatever random directory windows feeds it when started from a
shortcut

Reply | Threaded
Open this post in threaded view
|

Re: Include / Use search path

kintel
Administrator
In reply to this post by James Day
On Jan 4, 2012, at 10:28 AM, James Day wrote:
>
> How can you specifiy the search path for include files in OpenSCAD (for Windows) - I can't find this documented anywhere.
>

   Both use <path/file.scad> and include <path/file.scad> will search as follows:
   1) path-to-sourcefile/path/file.scad
   2) openscad-library-path/path/file.scad

   openscad-library-path is set to the first of the following paths which exist:
   OpenSCAD.app/Resources/libraries                    (Mac only)
   path/to/openscad-exe/../share/openscad/libraries    (Unix only)
   path/to/openscad-exe/../../share/openscad/libraries (Unix only)
   path/to/openscad-exe/../../libraries                (Unix only)
   path/to/openscad-exe/libraries
   
There is currently no way to edit or manually specify the search paths.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: Include / Use search path

Triffid Hunter
On Thu, Jan 5, 2012 at 5:01 AM, Marius Kintel <[hidden email]> wrote:
> There is currently no way to edit or manually specify the search paths.

feature request: grep an OPENSCAD_LIBRARY_PATH environment variable,
or a more appropriate name if you have something in mind

Reply | Threaded
Open this post in threaded view
|

Re: Include / Use search path

James Day
Thanks for the replies.

The include it seems does work as described.

It turns out I actually had an error in the include file which was on the same line as the include statement in the source file. Unless I'm missing something else, the error report didn't reflect that  - so I erroneuously assumed it couldn't find the include file.

Thanks,

James
Reply | Threaded
Open this post in threaded view
|

Re: Include / Use search path

kintel
Administrator
On Jan 8, 2012, at 12:27 PM, James Day wrote:

> It turns out I actually had an error in the include file which was on the same line as the include statement in the source file. Unless I'm missing something else, the error report didn't reflect that  - so I erroneuously assumed it couldn't find the include file.
>
Yes, you're right - I've taken note of that so we can improve it in the future.

 -Marius