discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Multiple arguments to -D in command line.

B
boriskourt
Fri, Aug 7, 2015 11:40 PM

Could someone give me an example of passing multiple arguments to -D in
command line?

Passing this works:

-D value_type=100

But this:

-D "value_type=100,value_two_type=2"

Or

-D value_type=100 value_two_type=2

And similar variations, cause an error.

What is the proper syntax?

Thanks,
Boris

--
View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Could someone give me an example of passing multiple arguments to -D in command line? Passing this works: -D value_type=100 But this: -D "value_type=100,value_two_type=2" Or -D value_type=100 value_two_type=2 And similar variations, cause an error. What is the proper syntax? Thanks, Boris -- View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472.html Sent from the OpenSCAD mailing list archive at Nabble.com.
AP
Andrew Plumb
Fri, Aug 7, 2015 11:55 PM

Think of the ‘-D’ option as appending code to the end of the file, not passing a variable value in:

openscad -D “value1=1;value2=\”a string\”” myCode.scad

Try this:

openscad -D “cube();” dummy.scad -o cube.stl

…where “dummy.scad” only contains a comment.

Very handy for dynamically generating content.

Andrew.

On Aug 7, 2015, at 7:40 PM, boriskourt boriskourt@gmail.com wrote:

Could someone give me an example of passing multiple arguments to -D in
command line?

Passing this works:

-D value_type=100

But this:

-D "value_type=100,value_two_type=2"

Or

-D value_type=100 value_two_type=2

And similar variations, cause an error.

What is the proper syntax?

Thanks,
Boris

--
View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472.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

Think of the ‘-D’ option as appending code to the end of the file, not passing a variable value in: openscad -D “value1=1;value2=\”a string\”” myCode.scad Try this: openscad -D “cube();” dummy.scad -o cube.stl …where “dummy.scad” only contains a comment. Very handy for dynamically generating content. Andrew. > On Aug 7, 2015, at 7:40 PM, boriskourt <boriskourt@gmail.com> wrote: > > Could someone give me an example of passing multiple arguments to -D in > command line? > > Passing this works: > > -D value_type=100 > > But this: > > -D "value_type=100,value_two_type=2" > > Or > > -D value_type=100 value_two_type=2 > > And similar variations, cause an error. > > What is the proper syntax? > > Thanks, > Boris > > > > -- > View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472.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
B
boriskourt
Fri, Aug 7, 2015 11:58 PM

Ah thank you for clarifying! This is infinitely more useful than I originally
thought!

--
View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472p13474.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Ah thank you for clarifying! This is infinitely more useful than I originally thought! -- View this message in context: http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472p13474.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JD
Jerry Davis
Sat, Aug 8, 2015 1:00 AM

I just tried it,

it works with:

openscad -D v1=100 -D v2=50 -D v3=10 somefile.scad

Jerry

--
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 Fri, Aug 7, 2015 at 7:58 PM, boriskourt boriskourt@gmail.com wrote:

Ah thank you for clarifying! This is infinitely more useful than I
originally
thought!

--
View this message in context:
http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472p13474.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 just tried it, it works with: openscad -D v1=100 -D v2=50 -D v3=10 somefile.scad Jerry -- 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 Fri, Aug 7, 2015 at 7:58 PM, boriskourt <boriskourt@gmail.com> wrote: > Ah thank you for clarifying! This is infinitely more useful than I > originally > thought! > > > > -- > View this message in context: > http://forum.openscad.org/Multiple-arguments-to-D-in-command-line-tp13472p13474.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 >