discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

get name of current module/function?

A
adrianv
Sun, Aug 11, 2019 9:05 PM

Is there a way to get the name of the current module or function, like a
$mod_name variable?  This would make it a little easier to write error
messages in a generic way that would continue to work if someone changed the
module's name.

--
Sent from: http://forum.openscad.org/

Is there a way to get the name of the current module or function, like a $mod_name variable? This would make it a little easier to write error messages in a generic way that would continue to work if someone changed the module's name. -- Sent from: http://forum.openscad.org/
NH
nop head
Sun, Aug 11, 2019 9:07 PM

Yes:
echo(parent_module(0));

On Sun, 11 Aug 2019 at 22:04, adrianv avm4@cornell.edu wrote:

Is there a way to get the name of the current module or function, like a
$mod_name variable?  This would make it a little easier to write error
messages in a generic way that would continue to work if someone changed
the
module's name.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes: echo(parent_module(0)); On Sun, 11 Aug 2019 at 22:04, adrianv <avm4@cornell.edu> wrote: > Is there a way to get the name of the current module or function, like a > $mod_name variable? This would make it a little easier to write error > messages in a generic way that would continue to work if someone changed > the > module's name. > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >