You can't include/use with a variable.
However if you don't mind using an experimental feature from
the dev snapshot, you can put the data into json files and
use something like:
file = "a.json";
data = import(file);
echo(data.a);
a.json
{
"a": 10
}
b.json
{
"a": 12
}
ciao,
Torsten.
sweet, data in a json file? that is awesome, I will definitely be giving that a try.
On Friday, November 25, 2022 at 12:19:31 PM PST, Torsten Paul torsten.paul@gmx.de wrote:
You can't include/use with a variable.
However if you don't mind using an experimental feature from
the dev snapshot, you can put the data into json files and
use something like:
file = "a.json";
data = import(file);
echo(data.a);
a.json
{
"a": 10
}
b.json
{
"a": 12
}
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Please help a beginner understand...
How does putting the data in a json file improve the situation?
Thanks
Bill Lugg
On 11/25/22 13:18, Torsten Paul wrote:
You can't include/use with a variable.
However if you don't mind using an experimental feature from
the dev snapshot, you can put the data into json files and
use something like:
file = "a.json";
data = import(file);
echo(data.a);
a.json
{
"a": 10
}
b.json
{
"a": 12
}
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I have only done a few test but so far the ability to use json for data is awesome!!! I have a lot of data and being able to use structured data makes coding way easier and should also make it much easier to maintain code as well.
On Friday, November 25, 2022 at 12:19:31 PM PST, Torsten Paul <torsten.paul@gmx.de> wrote:
You can't include/use with a variable.
However if you don't mind using an experimental feature from
the dev snapshot, you can put the data into json files and
use something like:
file = "a.json";
data = import(file);
echo(data.a);
a.json
{
"a": 10
}
b.json
{
"a": 12
}
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org