📄 protoolapp.cpp
字号:
// ProtoolApp.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "ProtoolApp.h"
//////////////////////////////////////////////////////////////////////////
//pro/toolkit的头文件
#include <ProToolkit.h>
#include <ProUtil.h>
#include <ProArray.h>
#include <ProDimension.h>
#include <ProWindows.h>
#include <ProSolid.h>
#include <ProParameter.h>
#include <ProParamval.h>
#include <ProMessage.h>
#include <ProMenu.h>
#include <ProMenuBar.h>
#include <ProMdl.h>
#include <ProModelitem.h>
#include <ProDrawing.h>
#include <ProFeature.h>
#include <ProFeatType.h>
#include <ProDrawing.h>
#include <ProNotify.h>
#include <ProRefInfo.h>
#include <ProRelSet.h>
#include <ProSelection.h>
//////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs, any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CProtoolAppApp
BEGIN_MESSAGE_MAP(CProtoolAppApp, CWinApp)
//{{AFX_MSG_MAP(CProtoolAppApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProtoolAppApp construction
CProtoolAppApp::CProtoolAppApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CProtoolAppApp object
CProtoolAppApp theApp;
ProFileName UserMsg;
ProMdl model;
ProFeature *features1;
static uiCmdAccessState TestAccessDefault(uiCmdAccessMode access_mode)
{
return(ACCESS_AVAILABLE);
}
int myMessageBox() //弹出一个windows窗口
{
AfxMessageBox ("弹出一个消息窗口。");
return(0);
}
int MiscAction()
{
myMessageBox();//弹出一个windows窗口
// myMessageDisplay();//消息区出一个消息。
//myGraphicsTextDisplay();//在屏幕显示字符
// myReadIn();//读入用户输入数据
// ProMdl model;
// ProMdlCurrentGet(&model);
// UserDemoHoleList( (ProSolid)model );
// UsrFeatList();
// UserSurfRename();
// myvisit();
return(0);
}
extern "C" int user_initialize(int argc
,char* argv[]
,char* version
,char* build
,wchar_t errbuf[80])
{
ProError status;
uiCmdCmdId cmd_id;
ProStringToWstring(UserMsg,"usermsg.txt");
ProMessageDisplay (UserMsg, "USER %0s","Demo of ProMenuBar.h functions.");
status = ProMenubarMenuAdd ("UserMenu","USER -UserMenu","Utilities",PRO_B_TRUE,UserMsg);
status = ProMenubarMenuAdd ("UserMenu1","USER -UserMenu","UserMenu",PRO_B_TRUE,UserMsg);
/*----------------------------------------------------------------*\
Add to the new menu.
\*----------------------------------------------------------------*/
status = ProCmdActionAdd ("MainBtn1", (uiCmdCmdActFn)MiscAction,
uiCmdPrioDefault, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE,
&cmd_id);
status = ProMenubarmenuPushbuttonAdd ("File", "MainBtn1",
"USER -MainBtn1", "USER New Button help.", NULL, PRO_B_TRUE,
cmd_id, UserMsg);
status = ProMenubarmenuPushbuttonAdd ("UserMenu1", "MainBtn2",
"USER -MainBtn1", "USER New Button help.", NULL, PRO_B_TRUE,
cmd_id, UserMsg);
status = ProMenubarmenuMenuAdd ("UserMenu", "Sub1", "USER -Sub1",
"MainBtn1", PRO_B_TRUE, UserMsg);
/*----------------------------------------------------------------*\
Fill in the buttons of Sub1.
\*----------------------------------------------------------------*/
status = ProMenubarmenuPushbuttonAdd ("Sub1", "Sub1Btn1",
"USER -Sub1Btn1", "USER New Button help.", NULL, PRO_B_TRUE,
cmd_id, UserMsg);
status = ProMenubarmenuPushbuttonAdd ("Sub1", "Sub1Btn2",
"USER -Sub1Btn2", "USER New Button help.", NULL, PRO_B_TRUE,
cmd_id, UserMsg);
return 0;
}
extern "C" void user_terninate(void)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -