Any number of sensible ways to do this don't exist.

You might be able to (shell dependent)
MYFILE=foo    dx -edit General.net
Then in General.net have ImportSpreadsheet use the "!" feature to echo $MYFILE
(directly or through a shell script) and if necessary other junk to satisfy
ImportSpreadsheet, then use the column name or data value to get MYFILE's
setting into your net, to feed to the filename input of the desired Import.
You could hide this ugliness in a macro.

You could also write (or someone could write) a trivial dxlink program that
starts dx with all remaining command-line parameters except the name=value
pairs that you strip off your dxlink program's command line and then send to dx
over the link.  Your net would then use DXLInputs to get the values where they
need to go (I think what Chris was getting at).

In terms of future changes to opendx to make it easy, or at least
straightforward:
IF (oh, if only!) System had an output then you could echo the environment
variable and then Parse it in your net.  System would be remarkably more useful
for other purposes too.
IF we permitted a command line argument to set name=value pairs, the net could
specify the name via DXLInput as above, and one could skip the "trivial dxlink
program" hassle.  This might be generalized to command-line specified script
commands which could prove very useful.

Pete

Chris Pelkie wrote:

> >Hi!
> >
> >I have the following problem: I have an OpenDX-program General.net
> >which I use to view different data files. The way I usualy work is the
> >following:
> >I call 'dx -program General.net' then I use a FileSelector to select
> >the data-file I want to view. Then I execute the program.
> >The way I would like to work is:
> >'dx -program General.net -execute_on_change *something* datafile'
> >where *something* is the part i don't know about.
> >
> >Is there a way to achive this (or something similar).
> >I havn't found anything like this in the manuals.
> >
> >(Note:I would still like to edit the program with the VPE)
> >
>
> There is no trivial way to do this. Unlike many other command-line driven
> programs you are familiar with, any DX net can contain an arbitrary number
> of Import/ImportSpreadsheet/ReadImage "input ports" (if you want to think
> of them like that). There is no mechanism to assign an arbitrary number of
> command-line parameters to these ports in the correct order. So it's not
> like a simpler Unix utility where you can just pipe stdin.
>
> I don't think I've ever used -program: I've always used "dx -edit
> General.net" (saves a couple keystrokes anyway (:-)  ). This puts you into
> the edit/execute mode (it comes up in "end execution" mode initially,
> though you correctly know how to bring it up in "execute on change").
>
> Frankly, you are doing what I've been doing for over 10 years: start the DX
> editor with a given net, change parameters to taste, then execute. If you
> are trying to make an end-user deliverable, I think you will have to either
> use a generic name for the data file and externally, and in advance of
> starting DX, make the currently desired file have that name, or show the
> user how to use FileSelector (or learn how to use DXLink). The generic
> filename solution has a weakness in that you must then teach the user how
> to do a Reset Connection (a very scary sounding, but quite benign
> proposition) if you externally change the data in the same-named file after
> DX has loaded and cached an earlier version under that name.
>
> I did not explain how to hack a script since you say you want to continue
> to edit in the VPE (my preferred method also). Probably obvious to you that
> given a script, you could easily parameterize the input name by passing it
> in via a shell script. This >could< be done to the saved net file itself,
> by the way, such that you change the net just before DX opens it. That is a
> relatively thin sheet of ice to venture onto but it will work.
>
> Chris Pelkie
> Vice President/Scientific Visualization Producer
> Conceptual Reality Presentations, Inc.
> 30 West Meadow Drive
> Ithaca, NY 14850
> [EMAIL PROTECTED]

Reply via email to