[OpenSCAD] new "Special Variable"?

Len Trigg lenbok at gmail.com
Tue May 5 20:39:31 EDT 2015


On 6 May 2015 at 10:31, jellsworth <jerry.ellsworth at gmail.com> wrote:

> * The problem here is that this clever approach leaves the version control
> users out in the cold, if they can only stamp their models based on
> filename.
>

You can pass variables in from outside by using the -D parameter to
openscad. Yvette could thus use a workaround wrapper script when launching
openscad that sets a variable to the current filename. In linux this would
look something like:

if [ "$1" ]; then
  openscad -D fileName=$(basename $1) $1
else
  openscad
fi

Similarly, if you have your files under version control you could
substitute the output of git describe as your version tag.

Cheers,
Len.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20150506/c95eb575/attachment-0002.html>


More information about the Discuss mailing list