[OpenSCAD] new "Special Variable"?

G. Wade Johnson gwadej at anomaly.org
Tue May 5 14:33:46 EDT 2015


I use a real version control system for this (currently, git) But then,
I'm a programmer, so version control makes sense.

Every system I've used in the past with special names or strings built
in to the text has failed because of the extra, independent manual
process of updating it.

So I use a tool built for that purpose.

On Tue, 5 May 2015 13:08:05 -0400
Ari Diacou <ari.diacou at gmail.com> wrote:

> I'm not sure about a special variable, but it would be great if there
> were any kind of version control. Like one that would count how many
> times you hit save, and another one that counted renders.
> 
> So each time I hit save and render, it would make a new version
> number.
> 
> e.g. if I have a file called widget, if I have saved it once, and
> rendered 6 times since that save, it would be automatically saved as
> e.g. widget.v1.06 when I hit render. It would also be nice if you
> could choose to compress the folder with all of these saves from
> OpenSCAD.
> 
> Or am I really just describing a program that could manage all of
> this for me outside of OpenSCAD?
> 
> On Tue, May 5, 2015 at 11:31 AM, Yvette S. Hirth, CCP, CDP <
> yvette at dbtgroup.com> wrote:
> 
> > hi,
> >
> > any way we can get the filename(s) being built stuffed into a
> > special variable?
> >
> > like, say, $fileName?  or $fileNameArray?
> >
> > i don't know if you can build more than one input file at a time;
> > all my .scad files are "one file per thing being built".  i do use
> > <include> and <use>, but only one input file.  so if only one input
> > file can be built, then $fileName is more appropriate; if multiple
> > input files can be built, then $fileNameArray is more appropriate.
> >
> > yes?  non?  eh?
> >
> > rationale:
> >
> > in each piece i build i stomp an "Engineering Change" (ec) level,
> > along with the version.
> >
> > e.g., a build file for ec0 might be named:  wondafulWidget_003.scad
> >
> > so i stomp "ec0_003" in the item being built; makes it easier to
> > trace "what made this thing?" issues.
> >
> > now i have to manually change the write() that stomps the ec tag.
> > while i'm not complaining about the workload (!), nonetheless, i've
> > forgotten to change the string in the write() several times when i
> > do a "Save As".  ex: Save As "wondafulWidget_004.scad" has the item
> > being built still stomped with "ec_003".  <big sigh>  a good waste
> > of time, carbon, and ABS!
> >
> > with the $fileName special variable, i can substring to the
> > version, glom the version into a variable, and stomp the variable.
> > that ends any confusion as to "what made what".
> >
> > thanks for listening!
> > yvette
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > Discuss at lists.openscad.org
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >


-- 
Doing nothing is very hard to do … you never know when you’re finished.
                                                   -- Leslie Nielsen




More information about the Discuss mailing list