@ian_jmp suggestion of calling the R routines from JMP might really be a great way of solving the problem.
If you really need to use a csv pass through data table, here is a simple example of one way to accomplish the creation of a csv file
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
sp = Scatterplot 3D(
Y( :age, :height, :weight ),
Frame3D( Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) )
);
sp << on close(
theScript = Char( (Report( sp ) << get scriptable object) << get script );
varsList = {};
Insert Into( varsList, Word( 2, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
Insert Into( varsList, Word( 4, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
Insert Into( varsList, Word( 6, Substr( theScript, Contains( theScript, "Y(" ) ), ":,)" ) );
rotationList = {};
Insert Into( rotationList, Word( 2, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
Insert Into( rotationList, Word( 3, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
Insert Into( rotationList, Word( 4, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
dtSub = dt << subset( columns( Eval( varsList ) ), selected rows( 0 ) );
dtSub << New Column( "_Vars_", character, set values( varsList ) );
dtSub << New Column( "_Rotation_", character, set values( rotationList ) );
dtSub << Save( "$TEMP/passvalues.csv" );
close( dtSub, nosave );
);
// This line opens the csv back into JMP
//open("$TEMP/passvalues.csv");
Jim