//==============================================================================
// WARNING!! This file is overwritten by the Block UI Styler while generating
// the automation code. Any modifications to this file will be lost after
// generating the code again.
//
// Filename: D:\NXopen\BaiduSyncdisk\studio\xuanzejiagongmian\ui\xuanzejiagongmian.cpp
//
// This file was generated by the NX Block UI Styler
// Created by: MICH-ROG
// Version: NX 12
// Date: 08-22-2025 (Format: mm-dd-yyyy)
// Time: 08:58 (Format: hh-mm)
//
//==============================================================================
//==============================================================================
// Purpose: This TEMPLATE file contains C++ source to guide you in the
// construction of your Block application dialog. The generation of your
// dialog file (.dlx extension) is the first step towards dialog construction
// within NX. You must now create a NX Open application that
// utilizes this file (.dlx).
//
// The information in this file provides you with the following:
//
// 1. Help on how to load and display your Block UI Styler dialog in NX
// using APIs provided in NXOpen.BlockStyler namespace
// 2. The empty callback methods (stubs) associated with your dialog items
// have also been placed in this file. These empty methods have been
// created simply to start you along with your coding requirements.
// The method name, argument list and possible return values have already
// been provided for you.
//==============================================================================
//------------------------------------------------------------------------------
//These includes are needed for the following template code
//------------------------------------------------------------------------------
#include "xuanzejiagongmian.hpp"
// 在文件顶部添加必要的头文件
#include <uf_ui_ont.h> // 加工导航器API
using namespace NXOpen;
using namespace NXOpen::BlockStyler;
// 获取选中的所有工序的切削区域面
void xuanzejiagongmian::LoadCuttingAreaToFaceControl()
{
try {
// 1. 获取当前工作部件
tag_t workPart = UF_PART_ask_display_part(); // 查询当前显示的NX部件
// 2. 获取用户选中的所有操作节点
int nodeCount = 0; // 选中节点数量
tag_t* selectedNodes = nullptr; // 选中节点数组指针
int ontStatus = UF_UI_ONT_ask_selected_nodes(&nodeCount, &selectedNodes); // 查询所有选中的操作节点
// 检查是否成功选中操作节点
if (ontStatus != 0 || nodeCount == 0 || selectedNodes == nullptr) {
return; // 未选中任何操作节点,直接返回
}
std::vector<TaggedObject*> faceObjects; // 存储所有面对象的容器
// 3. 遍历所有选中的操作节点
for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) {
tag_t operationTag = selectedNodes[nodeIndex]; // 当前操作节点标签
// 4. 获取当前操作的切削区域几何项
UF_CAM_geom_type_t geomType = UF_CAM_cut_area; // 定义几何类型为切削区域
int itemCount = 0; // 几何项数量
UF_CAMGEOM_item_t* items = nullptr; // 几何项数组指针
int result = UF_CAMGEOM_ask_items(operationTag, geomType, &itemCount, &items); // 查询切削区域几何项
// 检查是否成功获取几何项
if (result == 0 && itemCount > 0 && items != nullptr) {
// 遍历当前操作的所有几何项
for (int i = 0; i < itemCount; i++) {
tag_t entityTag = NULL_TAG; // 几何项实体标签
int itemResult = UF_CAMGEOM_ask_item_entity(items[i], &entityTag); // 获取几何项对应的实体标签
// 检查实体标签是否有效
if (itemResult == 0 && entityTag != NULL_TAG) {
int type = 0, subtype = 0; // 实体类型和子类型
UF_OBJ_ask_type_and_subtype(entityTag, &type, &subtype); // 查询实体的类型和子类型
// 处理面容器类型 (类型113, 子类型1)
if (type == 113 && subtype == 1) {
// 声明面容器相关变量
int nRules = 0; // 容器规则数量
int* ruleTypes = nullptr; // 容器规则类型数组
UF_SC_input_data_t* rules = nullptr; // 容器规则数据结构
int nFaceEids = 0; // 容器包含的面数量
tag_t* faceEids = nullptr; // 容器包含的面标签数组
// 查询面容器内容
int faceStatus = UF_MODL_ask_smart_face_container(
entityTag, // 面容器标签
&nRules, // 输出:规则数量
&ruleTypes, // 输出:规则类型数组
&rules, // 输出:规则数据结构
&nFaceEids, // 输出:面对象数量
&faceEids // 输出:面对象标签数组
);
// 检查是否成功获取面容器内容
if (faceStatus == 0) {
// 遍历容器中的所有面
for (int j = 0; j < nFaceEids; j++) {
TaggedObject* faceObj = NXObjectManager::Get(faceEids[j]); // 获取NX对象
if (faceObj) {
faceObjects.push_back(faceObj); // 添加到面对象列表
}
}
}
// 释放内存资源
if (ruleTypes) UF_free(ruleTypes); // 释放规则类型数组
if (rules) UF_free(rules); // 释放规则数据结构
if (faceEids) UF_free(faceEids); // 释放面标签数组
}
// 处理单个面类型 (类型70)
else if (type == 70) {
TaggedObject* faceObj = NXObjectManager::Get(entityTag); // 获取NX面对象
if (faceObj) {
faceObjects.push_back(faceObj); // 添加到面对象列表
}
}
}
}
UF_free(items); // 释放当前操作的几何项数组内存
}
}
// 释放选中的节点数组内存
UF_free(selectedNodes);
// 5. 将获取的所有面设置到面选择控件
if (!faceObjects.empty()) {
face1->SetSelectedObjects(faceObjects); // 设置面选择控件的选中对象
UF_DISP_refresh(); // 刷新NX显示
}
}
catch (exception& ex) {
// 异常处理(实际应用中可添加日志记录)
}
}
//------------------------------------------------------------------------------
// Initialize static variables
//------------------------------------------------------------------------------
Session *(xuanzejiagongmian::theSession) = NULL;
UI *(xuanzejiagongmian::theUI) = NULL;
//------------------------------------------------------------------------------
// Constructor for NX Styler class
//------------------------------------------------------------------------------
xuanzejiagongmian::xuanzejiagongmian()
{
try
{
// Initialize the NX Open C++ API environment
xuanzejiagongmian::theSession = NXOpen::Session::GetSession();
xuanzejiagongmian::theUI = UI::GetUI();
theDlxFileName = "xuanzejiagongmian.dlx";
theDialog = xuanzejiagongmian::theUI->CreateDialog(theDlxFileName);
// Registration of callback functions
theDialog->AddApplyHandler(make_callback(this, &xuanzejiagongmian::apply_cb));
theDialog->AddOkHandler(make_callback(this, &xuanzejiagongmian::ok_cb));
theDialog->AddUpdateHandler(make_callback(this, &xuanzejiagongmian::update_cb));
theDialog->AddInitializeHandler(make_callback(this, &xuanzejiagongmian::initialize_cb));
theDialog->AddDialogShownHandler(make_callback(this, &xuanzejiagongmian::dialogShown_cb));
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
throw;
}
}
//------------------------------------------------------------------------------
// Destructor for NX Styler class
//------------------------------------------------------------------------------
xuanzejiagongmian::~xuanzejiagongmian()
{
if (theDialog != NULL)
{
delete theDialog;
theDialog = NULL;
}
}
//------------------------------- DIALOG LAUNCHING ---------------------------------
//
// Before invoking this application one needs to open any part/empty part in NX
// because of the behavior of the blocks.
//
// Make sure the dlx file is in one of the following locations:
// 1.) From where NX session is launched
// 2.) $UGII_USER_DIR/application
// 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly
// recommended. This variable is set to a full directory path to a file
// containing a list of root directories for all custom applications.
// e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat
//
// You can create the dialog using one of the following way:
//
// 1. USER EXIT
//
// 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide"
// 2) Invoke the Shared Library through File->Execute->NX Open menu.
//
//------------------------------------------------------------------------------
extern "C" DllExport void ufusr(char *param, int *retcod, int param_len)
{
xuanzejiagongmian *thexuanzejiagongmian = NULL;
try
{
UF_initialize(); //开发的许可函数,初始化
thexuanzejiagongmian = new xuanzejiagongmian();
// The following method shows the dialog immediately
thexuanzejiagongmian->Show();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
if(thexuanzejiagongmian != NULL)
{
delete thexuanzejiagongmian;
thexuanzejiagongmian = NULL;
}UF_terminate(); //释放许可函数,结束化
}
//------------------------------------------------------------------------------
// This method specifies how a shared image is unloaded from memory
// within NX. This method gives you the capability to unload an
// internal NX Open application or user exit from NX. Specify any
// one of the three constants as a return value to determine the type
// of unload to perform:
//
//
// Immediately : unload the library as soon as the automation program has completed
// Explicitly : unload the library from the "Unload Shared Image" dialog
// AtTermination : unload the library when the NX session terminates
//
//
// NOTE: A program which associates NX Open applications with the menubar
// MUST NOT use this option since it will UNLOAD your NX Open application image
// from the menubar.
//------------------------------------------------------------------------------
extern "C" DllExport int ufusr_ask_unload()
{
//return (int)Session::LibraryUnloadOptionExplicitly;
return (int)Session::LibraryUnloadOptionImmediately;
//return (int)Session::LibraryUnloadOptionAtTermination;
}
//------------------------------------------------------------------------------
// Following method cleanup any housekeeping chores that may be needed.
// This method is automatically called by NX.
//------------------------------------------------------------------------------
extern "C" DllExport void ufusr_cleanup(void)
{
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
int xuanzejiagongmian::Show()
{
try
{
theDialog->Show();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return 0;
}
//------------------------------------------------------------------------------
//---------------------Block UI Styler Callback Functions--------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//Callback Name: initialize_cb
//------------------------------------------------------------------------------
void xuanzejiagongmian::initialize_cb()
{
try
{
group0 = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group0"));
face1 = dynamic_cast<NXOpen::BlockStyler::FaceCollector*>(theDialog->TopBlock()->FindBlock("face1"));
quxaioface = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("quxaioface"));
group = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group"));
color1 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color1"));
color2 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color2"));
color3 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color3"));
color4 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color4"));
bu1 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu1"));
bu2 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu2"));
bu3 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu3"));
bu4 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu4"));
color5 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color5"));
color6 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color6"));
color7 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color7"));
color8 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color8"));
bu5 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu5"));
bu6 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu6"));
bu7 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu7"));
bu8 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu8"));
color9 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color9"));
color10 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color10"));
color11 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color11"));
color12 = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("color12"));
bu9 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu9"));
bu10 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu10"));
bu11 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu11"));
bu12 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("bu12"));
group2 = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group2"));
dbpface = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("dbpface"));
gtbody = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("gtbody"));
arcface = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("arcface"));
gaodipoints = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("gaodipoints"));
Keyway1 = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("Keyway1"));
duanmian = dynamic_cast<NXOpen::BlockStyler::Button*>(theDialog->TopBlock()->FindBlock("duanmian"));
group1 = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group1"));
toggle0 = dynamic_cast<NXOpen::BlockStyler::Toggle*>(theDialog->TopBlock()->FindBlock("toggle0"));
colorguolv = dynamic_cast<NXOpen::BlockStyler::ObjectColorPicker*>(theDialog->TopBlock()->FindBlock("colorguolv"));
// 添加切削区域加载功能
LoadCuttingAreaToFaceControl();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
//------------------------------------------------------------------------------
//Callback Name: dialogShown_cb
//This callback is executed just before the dialog launch. Thus any value set
//here will take precedence and dialog will be launched showing that value.
//------------------------------------------------------------------------------
void xuanzejiagongmian::dialogShown_cb()
{
try
{
// 添加切削区域加载功能
LoadCuttingAreaToFaceControl();
//---- Enter your callback code here -----
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
//------------------------------------------------------------------------------
//Callback Name: apply_cb
//------------------------------------------------------------------------------
int xuanzejiagongmian::apply_cb()
{
int errorCode = 0;
int count = 0;
tag_t* selectedNodes = nullptr; // 存储选中的操作节点
try
{
// 1. 获取当前选中的所有操作
int ontStatus = UF_UI_ONT_ask_selected_nodes(&count, &selectedNodes);
// 检查是否选中操作
if (ontStatus != 0 || count <= 0 || selectedNodes == nullptr)
{
theUI->NXMessageBox()->Show("MICH-明提示", NXMessageBox::DialogTypeError,
"请先在加工导航器中选择一个或多个操作!");
return 1;
}
// 2. 从face1控件中获取选择的面
if (face1 == nullptr)
{
theUI->NXMessageBox()->Show("MICH-明错误", NXMessageBox::DialogTypeError,
"面选择控件未初始化!");
UF_free(selectedNodes); // 释放内存
return 2;
}
std::vector<TaggedObject*> selectedFaces = face1->GetSelectedObjects();
std::vector<tag_t> faceTags;
// 3. 准备面标签数组(如果有选中的面)
for (TaggedObject* faceObj : selectedFaces)
{
faceTags.push_back(faceObj->Tag());
}
int successCount = 0; // 成功添加面的操作计数
int totalFaces = faceTags.size(); // 总面数
std::vector<tag_t> failedOperations; // 记录失败的操作标签
int cleanupSuccessCount = 0; // 清理成功的操作计数
bool cleanupOnly = faceTags.empty(); // 标记是否只执行清理操作
// 4. 遍历所有选中的操作
for (int i = 0; i < count; i++)
{
tag_t operationTag = selectedNodes[i]; // 当前操作标签
// 4.1 清理现有切削区域
int removeResult = UF_CAMGEOM_delete_geometry(
operationTag, // 操作标签
UF_CAM_cut_area // 要移除的几何类型(切削区域)
);
// 4.2 处理清理结果
if (removeResult == 0 || removeResult == 9000001) // 9000001表示没有该类型几何体
{
cleanupSuccessCount++; // 清理成功
}
else if (removeResult != 0) // 其他错误
{
char removeErrorMsg[133];
UF_get_fail_message(removeResult, removeErrorMsg);
char logMsg[256];
snprintf(logMsg, sizeof(logMsg), "操作 %u 清理切削区域失败: %s", operationTag, removeErrorMsg);
// Logger::WriteLog(logMsg); // 记录日志
}
// 4.3 如果有选中的面,添加新的切削区域
if (!cleanupOnly)
{
int appendResult = UF_CAMGEOM_append_items(
operationTag, // 操作标签
UF_CAM_cut_area, // 切削区域类型
faceTags.size(), // 面数量
faceTags.data(), // 面标签数组
nullptr // 可选参数
);
if (appendResult == 0) {
successCount++; // 增加成功计数
}
else {
failedOperations.push_back(operationTag); // 记录失败操作
char appendErrorMsg[133];
UF_get_fail_message(appendResult, appendErrorMsg);
char logMsg[256];
snprintf(logMsg, sizeof(logMsg), "操作 %u 添加切削区域失败: %s", operationTag, appendErrorMsg);
// Logger::WriteLog(logMsg); // 记录日志
}
}
}
// 5. 释放内存
UF_free(selectedNodes);
selectedNodes = nullptr; // 防止悬空指针
// 6. 显示操作结果
char msg[512];
if (cleanupOnly)
{
// 只执行清理操作的情况
if (cleanupSuccessCount == count) {
snprintf(msg, sizeof(msg), "成功清理 %d 个操作中的切削区域!", count);
theUI->NXMessageBox()->Show("操作成功", NXMessageBox::DialogTypeInformation, msg);
errorCode = 0; // 全部成功
}
else if (cleanupSuccessCount > 0) {
snprintf(msg, sizeof(msg), "部分成功:清理了 %d/%d 个操作中的切削区域!",
cleanupSuccessCount, count);
theUI->NXMessageBox()->Show("操作结果", NXMessageBox::DialogTypeWarning, msg);
errorCode = 300; // 部分成功代码
}
else {
theUI->NXMessageBox()->Show("操作失败", NXMessageBox::DialogTypeError,
"所有操作的切削区域清理失败!");
errorCode = 400; // 全部失败代码
}
}
else
{
// 同时执行清理和添加操作的情况
if (successCount == count) {
snprintf(msg, sizeof(msg), "成功清理并添加 %d 个面到 %d 个操作!", totalFaces, count);
theUI->NXMessageBox()->Show("操作成功", NXMessageBox::DialogTypeInformation, msg);
errorCode = 0; // 全部成功
}
else if (successCount > 0) {
snprintf(msg, sizeof(msg), "部分成功:添加 %d 个面到 %d/%d 个操作!失败的操作: %zu 个",
totalFaces, successCount, count, failedOperations.size());
theUI->NXMessageBox()->Show("操作结果", NXMessageBox::DialogTypeWarning, msg);
errorCode = 100 + (int)failedOperations.size(); // 部分成功代码
}
else {
theUI->NXMessageBox()->Show("操作失败", NXMessageBox::DialogTypeError,
"所有操作添加切削区域失败!");
errorCode = 200; // 全部失败代码
}
}
// 7. 刷新显示
UF_DISP_refresh();
return errorCode; // 返回状态码
}
catch (const std::exception& ex)
{
// 异常处理
char errorMsg[512];
snprintf(errorMsg, sizeof(errorMsg), "发生异常: %s", ex.what());
theUI->NXMessageBox()->Show("系统错误", NXMessageBox::DialogTypeError, errorMsg);
// 确保释放内存
if (selectedNodes != nullptr) {
UF_free(selectedNodes);
selectedNodes = nullptr;
}
return 500; // 异常错误代码
}
}
//------------------------------------------------------------------------------
//Callback Name: update_cb
//------------------------------------------------------------------------------
int xuanzejiagongmian::update_cb(NXOpen::BlockStyler::UIBlock* block)
{
try
{
if(block == face1)
{
//---------Enter your code here-----------
}
else if(block == quxaioface)
{
///选择控件
vector<NXOpen::TaggedObject*> vFaces = face1->GetSelectedObjects();//获取选择的面(vFaces是自定义的类名,face1是控件ID,)
for (int i = 0; i < vFaces.size(); i++)//循环得到所有面
{
tag_t faceTag = vFaces[i]->Tag(); //得到面的tag
}
vFaces.clear(); //情况集合里面的对象(释放内存)
//清空变量,设置为空
vFaces.clear();//清空变量,(vFaces是自己前面定义的类名)
face1->SetSelectedObjects(vFaces);//选择控件设置为空,
//---------Enter your code here-----------
}
else if(block == color1)
{
//---------Enter your code here-----------
}
else if(block == color2)
{
//---------Enter your code here-----------
}
else if(block == color3)
{
//---------Enter your code here-----------
}
else if(block == color4)
{
//---------Enter your code here-----------
}
else if(block == bu1)
{
//---------Enter your code here-----------
}
else if(block == bu2)
{
//---------Enter your code here-----------
}
else if(block == bu3)
{
//---------Enter your code here-----------
}
else if(block == bu4)
{
//---------Enter your code here-----------
}
else if(block == color5)
{
//---------Enter your code here-----------
}
else if(block == color6)
{
//---------Enter your code here-----------
}
else if(block == color7)
{
//---------Enter your code here-----------
}
else if(block == color8)
{
//---------Enter your code here-----------
}
else if(block == bu5)
{
//---------Enter your code here-----------
}
else if(block == bu6)
{
//---------Enter your code here-----------
}
else if(block == bu7)
{
//---------Enter your code here-----------
}
else if(block == bu8)
{
//---------Enter your code here-----------
}
else if(block == color9)
{
//---------Enter your code here-----------
}
else if(block == color10)
{
//---------Enter your code here-----------
}
else if(block == color11)
{
//---------Enter your code here-----------
}
else if(block == color12)
{
//---------Enter your code here-----------
}
else if(block == bu9)
{
//---------Enter your code here-----------
}
else if(block == bu10)
{
//---------Enter your code here-----------
}
else if(block == bu11)
{
//---------Enter your code here-----------
}
else if(block == bu12)
{
//---------Enter your code here-----------
}
else if(block == dbpface)
{
//---------Enter your code here-----------
}
else if(block == gtbody)
{
//---------Enter your code here-----------
}
else if(block == arcface)
{
//---------Enter your code here-----------
}
else if(block == gaodipoints)
{
//---------Enter your code here-----------
}
else if(block == Keyway1)
{
//---------Enter your code here-----------
}
else if(block == duanmian)
{
//---------Enter your code here-----------
}
else if(block == toggle0)
{
//---------Enter your code here-----------
}
else if(block == colorguolv)
{
//---- Enter your callback code here -----
//---------Enter your code here-----------
}
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return 0;
}
//------------------------------------------------------------------------------
//Callback Name: ok_cb
//------------------------------------------------------------------------------
int xuanzejiagongmian::ok_cb()
{
int errorCode = 0;
try
{
errorCode = apply_cb();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
errorCode = 1;
xuanzejiagongmian::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return errorCode;
}
//------------------------------------------------------------------------------
//Function Name: GetBlockProperties
//Description: Returns the propertylist of the specified BlockID
//------------------------------------------------------------------------------
PropertyList* xuanzejiagongmian::GetBlockProperties(const char *blockID)
{
return theDialog->GetBlockProperties(blockID);
}
,请给我cpp完整的修改代码
最新发布