UserInterface.messageBox Method

Parent Object: UserInterface
Defined in namespace "adsk::core" and the header file is <Core/UserInterface/UserInterface.h>

Description

Display a modal message box with the provided text.

Syntax

"userInterface_var" is a variable referencing a UserInterface object.

# Uses no optional arguments.
returnValue = userInterface_var.messageBox(text)

# Uses optional arguments.
returnValue = userInterface_var.messageBox(text, title, buttons, icon)
"userInterface_var" is a variable referencing a UserInterface object.

#include <Core/UserInterface/UserInterface.h>

// Uses no optional arguments.
returnValue = userInterface_var->messageBox(text);

// Uses optional arguments.
returnValue = userInterface_var->messageBox(text, title, buttons, icon);
"userInterface_var" is a variable referencing a UserInterface object.

// Uses no optional arguments.
returnValue = userInterface_var.messageBox(text);

// Uses Optional arguments.
returnValue = userInterface_var.messageBox(text, title, buttons, icon);

Return Value

Type Description
DialogResults The button pressed to dismiss the dialog is returned.

Parameters

Name Type Description
text string The message text to display in the dialog.
title string If the optional title argument is provided, it sets the title for the dialog, otherwise the script or add-in name is used.

This is an optional argument whose default value is "".
buttons MessageBoxButtonTypes The optional buttons array can be used to specify which buttons to display on the dialog. The first button provided is the default action. If buttons are not specified, the dialog will default to a single OK button.

This is an optional argument whose default value is MessageBoxButtonTypes.OKButtonType.
icon MessageBoxIconTypes The optional icon argument can be used to specify which icon to display, otherwise the default of no icon is used.

This is an optional argument whose default value is MessageBoxIconTypes.NoIconIconType.

Samples

Name Description
Post Toolpaths API Sample

Demonstrates posting toolpaths in the active document using an NC program: import a post configuration from the post library, choose which setups or operations to include, set NC program and post parameters, and run NCProgram.postProcess.

Before running: Run from Scripts and Add-Ins with a design that contains at least one CAM setup with toolpaths. The script prompts for what to post (all setups, first setup, or first operation) and optionally opens the NC file when complete. It may offer to switch to the MANUFACTURE workspace.

Version

Introduced in version August 2014