Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New file boilerplate #4458

Open
jon-bondy opened this issue Dec 23, 2022 · 4 comments
Open

New file boilerplate #4458

jon-bondy opened this issue Dec 23, 2022 · 4 comments

Comments

@jon-bondy
Copy link

I start all of my OpenSCAD programs the same way, establishing some constants (like "inches = 25.4;") and importing/using some files. I type this in by hand, over and over and over again.

It would be nice if, when OS created a New file, and if a file like "Default.scad" is present in (say) the Library folder, then the New file is filled with the contents of the Default.scad file. Since this file will not exist on older installations, this new feature will only affect those who wish to use it going forward.

Thanks for considering this.

Jon

@jordanbrown0
Copy link
Contributor

Might be worthwhile, but note that you can reduce your per-file manual work to

include <Default.scad>

Note that then if you want to make a change to your boilerplate, it immediately affects all of your models. That might be good, or might be bad.

@t-paul
Copy link
Member

t-paul commented Dec 24, 2022

You can store your own code snippets in the config folder, e.g. on Linux .config/OpenSCAD/templates and insert those via ALT+INS or Context-Menu->Insert Template.

Example files: https://github.com/openscad/openscad/tree/master/templates

@jon-bondy
Copy link
Author

jon-bondy commented Dec 24, 2022 via email

@t-paul
Copy link
Member

t-paul commented Dec 24, 2022

Yes, I think we can keep this open as separate feature. However I would not go with a single fixed file, but instead something like "New from template" which can select from files either shipped or user provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants