Refreshing Gadgets
- Last UpdatedNov 12, 2025
- 1 minute read
In general, when a gadget is edited inside a PML callback function or macro the visual change is delayed until the entire callback has been executed or interactive input is sought. If you want to see the gadget’s appearance change immediately it is edited, use the method
!Gadget.Refresh()
You can also use the command REFRESH to refresh all gadgets of all displayed forms.
REFRESH is required after deleting Marine elements in an interactive DO LOOP. The following example, from a Draft macro, calls a Cursor Function from a DO LOOP to allow the user to interactively select SLAB elements for deletion, until terminated by pressing the ESC key.
do
id slab@
handle (61,528) $* Esc to exit
return
endhandle
!result = 'Picked ' + !!ce.name
$p $!result
delete slab
refresh $* Must refresh to force full PDMS update, else macro fails
enddo
Warning: Refreshing gadgets should be used sparingly, especially for View gadgets, as it will cause their content to be regenerated.