discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Dynamic Include

TO
Trevor Orr
Fri, Nov 25, 2022 9:38 PM

Well for me I can use my CMS and export all of my design data as json files instead of hand coding or having to generate scad files from the CMS.  This will save me a TON of time for what I am doing. Also having structured data will make things way easier for me.  I will have to rewrite some code but it will definitely be worth the time.
On Friday, November 25, 2022 at 01:32:09 PM PST, William Lugg via Discuss discuss@lists.openscad.org wrote:

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 =3D "a.json";
data =3D import(file);
echo(data.a);

a.json
{
=09"a": 10
}

b.json
{
=09"a": 12
}

ciao,
    Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Well for me I can use my CMS and export all of my design data as json files instead of hand coding or having to generate scad files from the CMS.  This will save me a TON of time for what I am doing. Also having structured data will make things way easier for me.  I will have to rewrite some code but it will definitely be worth the time. On Friday, November 25, 2022 at 01:32:09 PM PST, William Lugg via Discuss <discuss@lists.openscad.org> wrote: 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 =3D "a.json"; > data =3D import(file); > echo(data.a); > > a.json > { > =09"a": 10 > } > > b.json > { > =09"a": 12 > } > > ciao, >    Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org