@tom_abramov
A thought just popped into my head, and there is one way around this......This is a solution I have used many times for different reasons. What I suggest you do, is to write your code, so that what you do, is when you need to add the elements that you are referencing, you simply delete the entire graph and recreate it in it's place. The way JMP handles refresh, it will probably not show the change when the graph is deleted. It will probably just see that the graph has changed.
The code below illustrates my idea.
names default to here(1);
Open( "$SAMPLE_DATA/Big Class.jmp" );
new window("Test", vlb=vlistbox());
vlb<< append(gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y, Legend( 2 ) ) )
));
wait(5);
gb << delete;
vlb << append(gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 1 ) ) ),
Elements(
Position( 1, 2 ),
Bar( X, Y, Legend( 2 ), Label( "Label by Value" ) )
)
));
Jim