[OpenSCAD] new "Special Variable"?

Ivo ivo.knutsel at gmail.com
Wed May 6 03:33:48 EDT 2015

We already have the stack of modules available as variables:


A nice example of this feature is described here :

It would have been nice if parent_module() returns a vector of [modulename,
filename], that way we would have better information about the context.
[modulename, filename, path, timestamp] would be even better. It would also
clarify the issue : does file_name() return the file location of declaration
or of use. With that feature :

name = parent_module(0);

would give you the current module definition

name = parent_module($parent_modules);

would give you the current file.

As for a "number of times F6 was pressed" counter, there is no place to
store that. It should not go in the file (only i edit the file) and it is
impossible for openscad to decide if this is actually a new version. Version
control systems can output version files which you can include in the

With all this meta information available, it would be nice to get rid of the
"echo" in echo() and be able to format stuff prettier. I'd like to be able
to generate openscad files in openscad.

View this message in context: http://forum.openscad.org/new-Special-Variable-tp12579p12592.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list