project_dim.c

来自「基于UG的尺寸标准、尺寸公差,二次开发的源代码」· C语言 代码 · 共 91 行

C
91
字号
/*****************************************************************************
**
**  Project_Dim.c
**
**  Description:
**     Contains Unigraphics entry points for the application.
**
*****************************************************************************/

/*  Include files */
#include <stdio.h>
#include <uf.h>
#include <uf_ui.h>
#include <uf_mb.h>
#include "Project_Dim.h"
#include "project_dim_dialog.h"


/*****************************************************************************
**  Activation Methods
*****************************************************************************/

/*  Unigraphics Startup
**      This entry point activates the application at Unigraphics startup */
extern DllExport void ufsta( char *param, int *returnCode, int rlen )
{
    /* Initialize the API environment */
	UF_MB_cb_status_t Project_Dim_fun( UF_MB_widget_t,UF_MB_data_t,UF_MB_activated_button_p_t );
	static UF_MB_action_t actionTable[]=
	{
		{"PROJECT_DIM_ACTION",Project_Dim_fun,NULL},
		{NULL,NULL,NULL}
	};
    int errorCode = UF_initialize();
    if ( 0 == errorCode )
    {
        /* TODO: Add your application code here */
		UF_MB_add_actions(actionTable);
        /* Terminate the API environment */
        errorCode = UF_terminate();
    }

    /* Print out any error messages */
    PrintErrorMessage( errorCode );
}

UF_MB_cb_status_t Project_Dim_fun(UF_MB_widget_t widget
			,UF_MB_data_t client_data
			,UF_MB_activated_button_p_t call_button)
{

	PROJECT_DIM_PARMETER  m_dim_para;
	int                   response;
	LaunchProjectDimDialog(&response,&m_dim_para);

	return   UF_MB_CB_CONTINUE;

}
/*****************************************************************************
**  Utilities
*****************************************************************************/

/* Unload Handler
**     This function specifies when to unload your application from Unigraphics.
**     If your application registers a callback (from a MenuScript item or a
**     User Defined Object for example), this function MUST return
**     "UF_UNLOAD_UG_TERMINATE". */
extern int ufusr_ask_unload( void )
{
    return( UF_UNLOAD_UG_TERMINATE );
}

/* PrintErrorMessage
**
**     Prints error messages to standard error and the Unigraphics status
**     line. */
static void PrintErrorMessage( int errorCode )
{
    if ( 0 != errorCode )
    {
        /* Retrieve the associated error message */
        char message[133];
        UF_get_fail_message( errorCode, message );

        /* Print out the message */
        UF_UI_set_status( message );

        fprintf( stderr, "%s\n", message );
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?