discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Parameterlist Excel export to OpenSCAD

JJ
Johan Jonker
Wed, Dec 30, 2015 12:54 PM

I have an Openscad file for a saxophone key with a lot of parameters, that
can change depending on the brand of the saxophone and the type of key that
I want to add in the future.

To keep the code readable I made a separate scad file with parameters that
is imported in the head of the scad. I wonder if there is an easy way to
maintain the whole serie of parameters in an excel file and import a
selected file to Openscad.
http://forum.openscad.org/file/n15363/parameters.jpg
So I made an excel file where the set of parameters is selectable and in one
column the code appears that I can copy and paste to openscad.

Is there a better way to link Excel to Openscad?
http://forum.openscad.org/file/n15363/parameters2.jpg

--
View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I have an Openscad file for a saxophone key with a lot of parameters, that can change depending on the brand of the saxophone and the type of key that I want to add in the future. To keep the code readable I made a separate scad file with parameters that is imported in the head of the scad. I wonder if there is an easy way to maintain the whole serie of parameters in an excel file and import a selected file to Openscad. <http://forum.openscad.org/file/n15363/parameters.jpg> So I made an excel file where the set of parameters is selectable and in one column the code appears that I can copy and paste to openscad. Is there a better way to link Excel to Openscad? <http://forum.openscad.org/file/n15363/parameters2.jpg> -- View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html Sent from the OpenSCAD mailing list archive at Nabble.com.
SG
Stefan Göttsche
Wed, Dec 30, 2015 1:04 PM

I am sure there are people that have more knowledge about this than me,
but Excel can export to txt file, and OpenSCAD can be set to
surveillance changes in a scad file.

Eventually, if you could get Excel (Via macro automation or VBA, or
manually if all fails) to calculate and export to file what you want,
OpenSCAD would then notice the change in that file and recompile?

On 30. des. 2015 13:54, Johan Jonker wrote:

I have an Openscad file for a saxophone key with a lot of parameters, that
can change depending on the brand of the saxophone and the type of key that
I want to add in the future.

To keep the code readable I made a separate scad file with parameters that
is imported in the head of the scad. I wonder if there is an easy way to
maintain the whole serie of parameters in an excel file and import a
selected file to Openscad.
http://forum.openscad.org/file/n15363/parameters.jpg
So I made an excel file where the set of parameters is selectable and in one
column the code appears that I can copy and paste to openscad.

Is there a better way to link Excel to Openscad?
http://forum.openscad.org/file/n15363/parameters2.jpg

--
View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

I am sure there are people that have more knowledge about this than me, but Excel can export to txt file, and OpenSCAD can be set to surveillance changes in a scad file. Eventually, if you could get Excel (Via macro automation or VBA, or manually if all fails) to calculate and export to file what you want, OpenSCAD would then notice the change in that file and recompile? On 30. des. 2015 13:54, Johan Jonker wrote: > I have an Openscad file for a saxophone key with a lot of parameters, that > can change depending on the brand of the saxophone and the type of key that > I want to add in the future. > > To keep the code readable I made a separate scad file with parameters that > is imported in the head of the scad. I wonder if there is an easy way to > maintain the whole serie of parameters in an excel file and import a > selected file to Openscad. > <http://forum.openscad.org/file/n15363/parameters.jpg> > So I made an excel file where the set of parameters is selectable and in one > column the code appears that I can copy and paste to openscad. > > Is there a better way to link Excel to Openscad? > <http://forum.openscad.org/file/n15363/parameters2.jpg> > > > > -- > View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
NH
nop head
Wed, Dec 30, 2015 1:44 PM

You can do it all in the OpenScad file by putting the parameters in names
lists, one for each model of saxaphone and simply passing that named list
to a module to draw it or assigning it to a global variable.

On 30 December 2015 at 13:04, Stefan Göttsche stefan.gottsche@gmail.com
wrote:

I am sure there are people that have more knowledge about this than me,
but Excel can export to txt file, and OpenSCAD can be set to surveillance
changes in a scad file.

Eventually, if you could get Excel (Via macro automation or VBA, or
manually if all fails) to calculate and export to file what you want,
OpenSCAD would then notice the change in that file and recompile?

On 30. des. 2015 13:54, Johan Jonker wrote:

I have an Openscad file for a saxophone key with a lot of parameters, that
can change depending on the brand of the saxophone and the type of key
that
I want to add in the future.

To keep the code readable I made a separate scad file with parameters that
is imported in the head of the scad. I wonder if there is an easy way to
maintain the whole serie of parameters in an excel file and import a
selected file to Openscad.
http://forum.openscad.org/file/n15363/parameters.jpg
So I made an excel file where the set of parameters is selectable and in
one
column the code appears that I can copy and paste to openscad.

Is there a better way to link Excel to Openscad?
http://forum.openscad.org/file/n15363/parameters2.jpg

--
View this message in context:
http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

You can do it all in the OpenScad file by putting the parameters in names lists, one for each model of saxaphone and simply passing that named list to a module to draw it or assigning it to a global variable. On 30 December 2015 at 13:04, Stefan Göttsche <stefan.gottsche@gmail.com> wrote: > I am sure there are people that have more knowledge about this than me, > but Excel can export to txt file, and OpenSCAD can be set to surveillance > changes in a scad file. > > Eventually, if you could get Excel (Via macro automation or VBA, or > manually if all fails) to calculate and export to file what you want, > OpenSCAD would then notice the change in that file and recompile? > > > > On 30. des. 2015 13:54, Johan Jonker wrote: > >> I have an Openscad file for a saxophone key with a lot of parameters, that >> can change depending on the brand of the saxophone and the type of key >> that >> I want to add in the future. >> >> To keep the code readable I made a separate scad file with parameters that >> is imported in the head of the scad. I wonder if there is an easy way to >> maintain the whole serie of parameters in an excel file and import a >> selected file to Openscad. >> <http://forum.openscad.org/file/n15363/parameters.jpg> >> So I made an excel file where the set of parameters is selectable and in >> one >> column the code appears that I can copy and paste to openscad. >> >> Is there a better way to link Excel to Openscad? >> <http://forum.openscad.org/file/n15363/parameters2.jpg> >> >> >> >> -- >> View this message in context: >> http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
WA
William Adams
Wed, Dec 30, 2015 1:44 PM

I've just been doing something similar --- I have an Excel spreadsheet
which has several worksheets w/ the client data in it, and a
``customization'' worksheet which imports all the settings specified by the
customer, in the proper order and wrapped up w/ conditional cells which
only populate w/ TeX commands if the matching cell has content:

=IF(B13="","",1) --- repeated all the way down in a column

=IF(SUM(F13:F16)=4,"\fouruppage{",IF(SUM(F13:F16)=3,"\fouruppageThree{",IF(SUM(F13:F16)=2,"\fouruppageTwo{",IF(SUM(F13:F16)=1,"\fouruppageOne{",IF(SUM(F13:F16)=0,"")))))

&c.

(It was a lot easier than reading the customer files into lualatex and
redefining the macros there)

William

On Wed, Dec 30, 2015 at 8:04 AM, Stefan Göttsche stefan.gottsche@gmail.com
wrote:

I am sure there are people that have more knowledge about this than me,
but Excel can export to txt file, and OpenSCAD can be set to surveillance
changes in a scad file.

Eventually, if you could get Excel (Via macro automation or VBA, or
manually if all fails) to calculate and export to file what you want,
OpenSCAD would then notice the change in that file and recompile?

On 30. des. 2015 13:54, Johan Jonker wrote:

I have an Openscad file for a saxophone key with a lot of parameters, that
can change depending on the brand of the saxophone and the type of key
that
I want to add in the future.

To keep the code readable I made a separate scad file with parameters that
is imported in the head of the scad. I wonder if there is an easy way to
maintain the whole serie of parameters in an excel file and import a
selected file to Openscad.
http://forum.openscad.org/file/n15363/parameters.jpg
So I made an excel file where the set of parameters is selectable and in
one
column the code appears that I can copy and paste to openscad.

Is there a better way to link Excel to Openscad?
http://forum.openscad.org/file/n15363/parameters2.jpg

--
View this message in context:
http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

I've just been doing something similar --- I have an Excel spreadsheet which has several worksheets w/ the client data in it, and a ``customization'' worksheet which imports all the settings specified by the customer, in the proper order and wrapped up w/ conditional cells which only populate w/ TeX commands if the matching cell has content: =IF(B13="","",1) --- repeated all the way down in a column =IF(SUM(F13:F16)=4,"\fouruppage{",IF(SUM(F13:F16)=3,"\fouruppageThree{",IF(SUM(F13:F16)=2,"\fouruppageTwo{",IF(SUM(F13:F16)=1,"\fouruppageOne{",IF(SUM(F13:F16)=0,""))))) &c. (It was a lot easier than reading the customer files into lualatex and redefining the macros there) William On Wed, Dec 30, 2015 at 8:04 AM, Stefan Göttsche <stefan.gottsche@gmail.com> wrote: > I am sure there are people that have more knowledge about this than me, > but Excel can export to txt file, and OpenSCAD can be set to surveillance > changes in a scad file. > > Eventually, if you could get Excel (Via macro automation or VBA, or > manually if all fails) to calculate and export to file what you want, > OpenSCAD would then notice the change in that file and recompile? > > > > On 30. des. 2015 13:54, Johan Jonker wrote: > >> I have an Openscad file for a saxophone key with a lot of parameters, that >> can change depending on the brand of the saxophone and the type of key >> that >> I want to add in the future. >> >> To keep the code readable I made a separate scad file with parameters that >> is imported in the head of the scad. I wonder if there is an easy way to >> maintain the whole serie of parameters in an excel file and import a >> selected file to Openscad. >> <http://forum.openscad.org/file/n15363/parameters.jpg> >> So I made an excel file where the set of parameters is selectable and in >> one >> column the code appears that I can copy and paste to openscad. >> >> Is there a better way to link Excel to Openscad? >> <http://forum.openscad.org/file/n15363/parameters2.jpg> >> >> >> >> -- >> View this message in context: >> http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JJ
Johan Jonker
Wed, Dec 30, 2015 3:52 PM

I made a macro in the excel file that reacts on just a button click and
exports the table to an scad file.
So it is just two clicks to modify: One in the excel and then F5 to refresh
Openscad.

This is the macro listing:
Sub Macro1()
Dim myFile As String, rng As Range, cellValue As Variant, i As Integer, j As
Integer

myFile = Application.ActiveWorkbook.Path & "" & Cells(5, 4).Value
Cells(6, 4) = myFile

ActiveSheet.Range("D9:D100").Select

Set rng = Selection

Open myFile For Output As #1
    For i = 1 To rng.Rows.Count
            cellValue = rng.Cells(i, 1).Value
                Print #1, Replace(cellValue, ",", "."), vbCrLf,
    Next i
Close #1

End Sub

http://forum.openscad.org/file/n15367/parameters3.jpg

--
View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15367.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I made a macro in the excel file that reacts on just a button click and exports the table to an scad file. So it is just two clicks to modify: One in the excel and then F5 to refresh Openscad. This is the macro listing: Sub Macro1() Dim myFile As String, rng As Range, cellValue As Variant, i As Integer, j As Integer myFile = Application.ActiveWorkbook.Path & "\" & Cells(5, 4).Value Cells(6, 4) = myFile ActiveSheet.Range("D9:D100").Select Set rng = Selection Open myFile For Output As #1 For i = 1 To rng.Rows.Count cellValue = rng.Cells(i, 1).Value Print #1, Replace(cellValue, ",", "."), vbCrLf, Next i Close #1 End Sub <http://forum.openscad.org/file/n15367/parameters3.jpg> -- View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15367.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Wed, Dec 30, 2015 4:00 PM

nophead’s suggestion sounds decent to me.
I’d be interested in what your ideal solution would look like.

As a teaser: We’ve been discussing introducing dictionary-style objects as a core datatype in OpenSCAD. This would allow us to import e.g. JSON documents and store the resulting object as an OpenSCAD value.
This is just one idea. If you have others, please share!

-Marius

nophead’s suggestion sounds decent to me. I’d be interested in what your ideal solution would look like. As a teaser: We’ve been discussing introducing dictionary-style objects as a core datatype in OpenSCAD. This would allow us to import e.g. JSON documents and store the resulting object as an OpenSCAD value. This is just one idea. If you have others, please share! -Marius
JD
Jerry Davis
Wed, Dec 30, 2015 4:52 PM

can you give some examples of usage of the dictionary objects would be?

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

I
*f you give someone a program, you will frustrate them for a day; if you
teach them how to program, you will frustrate them for a lifetime. *-
Anonymous

If writing good code requires very little comments, then writing really
excellent code requires no comments at all!
- Ken Thompson

On Wed, Dec 30, 2015 at 9:00 AM, Marius Kintel marius@kintel.net wrote:

nophead’s suggestion sounds decent to me.
I’d be interested in what your ideal solution would look like.

As a teaser: We’ve been discussing introducing dictionary-style objects as
a core datatype in OpenSCAD. This would allow us to import e.g. JSON
documents and store the resulting object as an OpenSCAD value.
This is just one idea. If you have others, please share!

-Marius


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

can you give some examples of usage of the dictionary objects would be? -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Arduino developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov *I* *f you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. *- Anonymous *If writing good code requires very little comments, then writing really excellent code requires no comments at all!*- Ken Thompson On Wed, Dec 30, 2015 at 9:00 AM, Marius Kintel <marius@kintel.net> wrote: > nophead’s suggestion sounds decent to me. > I’d be interested in what your ideal solution would look like. > > As a teaser: We’ve been discussing introducing dictionary-style objects as > a core datatype in OpenSCAD. This would allow us to import e.g. JSON > documents and store the resulting object as an OpenSCAD value. > This is just one idea. If you have others, please share! > > -Marius > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JJ
Johan Jonker
Wed, Dec 30, 2015 5:00 PM

Here are the files:

parameters_palm_keys.xlsm
http://forum.openscad.org/file/n15370/parameters_palm_keys.xlsm

palmkey_saxophone.scad
http://forum.openscad.org/file/n15370/palmkey_saxophone.scad

You also need spline and nacasweep in the same directory

--
View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15370.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Here are the files: parameters_palm_keys.xlsm <http://forum.openscad.org/file/n15370/parameters_palm_keys.xlsm> palmkey_saxophone.scad <http://forum.openscad.org/file/n15370/palmkey_saxophone.scad> You also need spline and nacasweep in the same directory -- View this message in context: http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15370.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Wed, Dec 30, 2015 5:05 PM

Marius may be referring to my OpenSCAD2 proposal, in which "dictionary
objects" are just called "objects".
The OpenSCAD2 docs are in github: https://github.com/doug-moen/openscad2/

The object proposal is here:
https://github.com/doug-moen/openscad2/blob/master/rfc/Objects.md

https://github.com/doug-moen/openscad2/blob/master/rfc/Programming_With_Objects.md

There are lots of use cases given: you might as well click through and read
about them in the linked documents.

On 30 December 2015 at 11:52, Jerry Davis jdawgaz@gmail.com wrote:

can you give some examples of usage of the dictionary objects would be?

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

I
*f you give someone a program, you will frustrate them for a day; if you
teach them how to program, you will frustrate them for a lifetime. *-
Anonymous

If writing good code requires very little comments, then writing really
excellent code requires no comments at all!
- Ken Thompson

On Wed, Dec 30, 2015 at 9:00 AM, Marius Kintel marius@kintel.net wrote:

nophead’s suggestion sounds decent to me.
I’d be interested in what your ideal solution would look like.

As a teaser: We’ve been discussing introducing dictionary-style objects
as a core datatype in OpenSCAD. This would allow us to import e.g. JSON
documents and store the resulting object as an OpenSCAD value.
This is just one idea. If you have others, please share!

-Marius


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

Marius may be referring to my OpenSCAD2 proposal, in which "dictionary objects" are just called "objects". The OpenSCAD2 docs are in github: https://github.com/doug-moen/openscad2/ The object proposal is here: https://github.com/doug-moen/openscad2/blob/master/rfc/Objects.md https://github.com/doug-moen/openscad2/blob/master/rfc/Programming_With_Objects.md There are lots of use cases given: you might as well click through and read about them in the linked documents. On 30 December 2015 at 11:52, Jerry Davis <jdawgaz@gmail.com> wrote: > can you give some examples of usage of the dictionary objects would be? > > > -- > Extra Ham Operator: K7AZJ > Registered Linux User: 275424 > Raspberry Pi and Arduino developer > > > *The most exciting phrase to hear in science - the one that heralds new > discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov > > *I* > *f you give someone a program, you will frustrate them for a day; if you > teach them how to program, you will frustrate them for a lifetime. *- > Anonymous > > > *If writing good code requires very little comments, then writing really > excellent code requires no comments at all!*- Ken Thompson > > On Wed, Dec 30, 2015 at 9:00 AM, Marius Kintel <marius@kintel.net> wrote: > >> nophead’s suggestion sounds decent to me. >> I’d be interested in what your ideal solution would look like. >> >> As a teaser: We’ve been discussing introducing dictionary-style objects >> as a core datatype in OpenSCAD. This would allow us to import e.g. JSON >> documents and store the resulting object as an OpenSCAD value. >> This is just one idea. If you have others, please share! >> >> -Marius >> >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
DM
doug moen
Wed, Dec 30, 2015 5:13 PM

Thanks for sharing your code. This is a cool example of curved surfaces and
splines in a real engineering type of model.

On 30 December 2015 at 12:00, Johan Jonker johangjonker@zonnet.nl wrote:

Here are the files:

parameters_palm_keys.xlsm
http://forum.openscad.org/file/n15370/parameters_palm_keys.xlsm

palmkey_saxophone.scad
http://forum.openscad.org/file/n15370/palmkey_saxophone.scad

You also need spline and nacasweep in the same directory

--
View this message in context:
http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15370.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

Thanks for sharing your code. This is a cool example of curved surfaces and splines in a real engineering type of model. On 30 December 2015 at 12:00, Johan Jonker <johangjonker@zonnet.nl> wrote: > Here are the files: > > parameters_palm_keys.xlsm > <http://forum.openscad.org/file/n15370/parameters_palm_keys.xlsm> > > palmkey_saxophone.scad > <http://forum.openscad.org/file/n15370/palmkey_saxophone.scad> > > You also need spline and nacasweep in the same directory > > > > -- > View this message in context: > http://forum.openscad.org/Parameterlist-Excel-export-to-OpenSCAD-tp15363p15370.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > >