Utility Functions

ic_mess args

Prints the given message to the message window or the standard output if MED is being run in batch mode. There may be 1 or 2 arguments. The first is the string and the second if given is the color to print the message in.

ic_print_error_log res

Prints the error log res to the screen in red. If there are more than 64 lines, they will all be saved to a temporary file such as the default /tmp/ERROR_LOG0.tmp

ic_write_file name text

Creates a file with some stuff in it.

ic_quit

Quits MED and save the current project settings.

ic_dialog args

Calls the tk_dialog utility function.

ic_question args

Queries you to input a string value.

ic_confirm mess

Presents a dialog with a message and one button that says OK that just dismisses the dialog.

ic_yes_or_no mess

Presents a dialog with a message and 2 buttons, which say Yes or No. Returns 1 or 0 depending on which is pressed.

ic_multiple_choice mess args

Presents a dialog with a message and multiple buttons with the given labels. Returns the ordinal of the one that is pressed.

ic_multiple_choice_default default mess args

Same as ic_multiple_choice but default gives the index of the button that is to be the default button for the dialog. If less than zero then there will not be any default button.

ic_pause ms

Waits for ms milliseconds, process regular Tk events, and then returns.

ic_batch_mode

Checks for batch mode.

ic_run_application_command dir progdir progname arguments

Runs some external application.

ic_run_application_batch dir progdir progname envname arguments logfile [""]

Runs some external application in batch mode

ic_run_application_exec dir progdir progname arguments

Runs some external application, given the full path.

ic_exec args

A simplified version of this.

ic_run_application_direct dir progdir progname envname arguments

Runs an application.

ic_remove_duplicate names

Removes duplicates from list of names.

ic_undo

Undoes the previous action.

ic_redo

Redoes the previous undone action.

ic_undo_group_begin text [undo_group]

Sets undo group begin.

ic_undo_group_end text [undo_group]

Sets undo group end.

ic_undo_suspend

Suspends undo logging.

ic_undo_suspended

State of undo manager.

ic_undo_resume

Resumes undo logging.

ic_undo_start

Starts undo handler; started by default.

ic_undo_stop

Stops undo handler; removes undo log.

ic_undo_clear

Clears undo events and restarts undo log.

ic_archive_dir dir archive

Allows you to tar and gzip the directory dir as archive.

ic_unarchive_file file dest

Allows you to untar and gunzip the archive file in directory dest.

ic_stopwatch_start

Starts a stopwatch, in milliseconds.

ic_stopwatch_get_elapsed stop_the_watch [0]

Gets the elapsed time, in milliseconds, since start of the stopwatch. Optional argument stop_the_watch will also stop the watch.

ic_stopwatch_end

Stops the current stopwatch.

ic_list_uniquify list

Uniquifies given TCL list list. Note that this function returns the list sorted.

ic_list_remove_duplicated list

For every non-unique element in given TCL list list, remove all instances. Note that this function returns the list sorted.

ic_list_get_duplicated list

This returns the duplicated items in a list

ic_list_remove_from_grouped groups orig

Takes a list of groups and an original list and returns items in orig that are not in groups

ic_list_median list

Gets the median in the list.

ic_chdir dir

Changes working directory.

ic_check_licensing_aienv

Checks to see if ai*env licensing is enabled.

ic_reinit_geom_objects all [""]

Redefines graphics for geometry.

ic_error

For testing.