NXOpen UG二次开发

一、创建ug菜单

1、安装ug110.0版本

2、在Program Files\Siemens\NX 10.0\TKLTOOLS目录下创建“startup”文件夹,在文件夹中创建“模具.men”文件

3、添加代码

VERSION 120
EDIT UG_GATEWAY_MAIN_MENUBAR         //编辑ug的主菜单

AFTER UG_HELP                 		 //在help后面添加
	CASCADE_BUTTON moju  			 //定义ID 
	LABEL 模具  					    //标签名字(显示的名字)
END_OF_AFTER

MENU moju   						 //设计ID为moju的子菜单
BUTTON 111  						 //定义第一个按钮的ID
LABEL 知识检索  					  //标签名字(显示的名字)
BITMAP       						 //可以添加图案
ACTIONS webjiansuo 					 //需要链接的dll文件名(dll文件为点击该按钮后弹出的对话框)

BUTTON 222
LABEL 方案推荐
BITMAP
ACTIONS FangAnTuiJian

BUTTON 333
LABEL 人工审核
BITMAP
ACTIONS evaluate

END_OF_MENU   

​ 4、添加环境变量

​ [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GmQPZMaB-1657869876988)(C:\Users\123\Desktop\1.png)]

二、设计对话框

1、打开ug,点击:新建–>确定–>启动–>所有应用模具–>块UI样式编辑器。

2、设计对话框的样式,按钮,下拉框,显示的内容等。

3、 设计完成后,点击:代码生成,语言选择c++

4、点击:文件–>保存,选择保存路径,点击:OK。会保存后缀分别为“.dlx”, ".h"和“.cpp”的文件

三、编辑对话框

1、打开visual studo软件,新建项目,选择NX10 NXopen Wizard 点击新建;

2、新建完成后删除存在的cpp文件,将第二步生成的“.h”和“.cpp”添加到新建的项目中。弹出的对话框中语言选择c++;下一步选择

Automatically (ufsta) 和Automatically, when the NX session terminates ;点击完成。

3、在“.h”中引入头文件

#include <Windows.h>

#ifdef CreateDialog
#undef CreateDialog
#endif


#include <uf.h>
#include <uf_ui.h>
#include <uf_exit.h>
#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/ModelingView.hxx>
#include <NXOpen/ModelingViewCollection.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <uf_ui.h>
#include <uf_ui_ugopen.h>
#include <uf.h>
#include <NXOpen/Session.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/selection.hxx>
#include <NXOpen/Features_Feature.hxx>
#include <NXOpen/ListingWindow.hxx>
#include <uf_obj.h>
#include <uf_attr.h>
#include <uf_cfi.h>
#include <uf_curve.h>
#include <uf_modl_primitives.h>
#include <stdlib.h>
#include <uf_modl.h>

#include <uf_defs.h>
#include <uf_ui_types.h>
#include <iostream>
#include <NXOpen/Session.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/NXMessageBox.hxx>
#include <NXOpen/Callback.hxx>
#include <NXOpen/NXException.hxx>
#include <NXOpen/BlockStyler_UIBlock.hxx>
#include <NXOpen/BlockStyler_BlockDialog.hxx>
#include <NXOpen/BlockStyler_PropertyList.hxx>
#include <NXOpen/BlockStyler_Enumeration.hxx>
#include <NXOpen/BlockStyler_Group.hxx>
#include <NXOpen/BlockStyler_Button.hxx>


#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Assemblies_AssembliesGeneralPropertiesBuilder.hxx>
#include <NXOpen/Assemblies_AssembliesParameterPropertiesBuilder.hxx>
#include <NXOpen/Assemblies_Component.hxx>
#include <NXOpen/Assemblies_ComponentAssembly.hxx>
#include <NXOpen/Assemblies_SelectComponentList.hxx>
#include <NXOpen/AttributeManager.hxx>
#include <NXOpen/AttributePropertiesBaseBuilder.hxx>
#include <NXOpen/AttributePropertiesBuilder.hxx>
#include <NXOpen/BasePart.hxx>
#include <NXOpen/Builder.hxx>
#include <NXOpen/DateBuilder.hxx>
#include <NXOpen/DateItemBuilder.hxx>
#include <NXOpen/DateItemBuilderList.hxx>
#include <NXOpen/Expression.hxx>
#include <NXOpen/MassPropertiesBuilder.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/ObjectGeneralPropertiesBuilder.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/PropertiesManager.hxx>
#include <NXOpen/SelectNXObjectList.hxx>
#include <NXOpen/SelectObjectList.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Update.hxx>
#include <NXOpen/NXObjectManager.hxx>

四、在“.cpp"中添加添加属性函数

1、方案评估代码

void messaage()函数 //给对象添加属性

/* Initialize the API environment */
	if (UF_CALL(UF_initialize()))
	{
		return;
	}

	//获取所选择对象的标签
	tag_t tagUnderFace = 0;
	std::vector<TaggedObject*>objects = this->selection0->GetProperties()->GetTaggedObjectVector("SelectedObjects");
	for (int i = 0; i<objects.size(); i++)
	{
		tagUnderFace = objects[i]->Tag();
	}

	UF_ATTR_value_t value;
	//分配一个“字符串”属性给对象
	PropertyList*  enumProps = enum01->GetProperties();//获取零件类型的标签(Type为零件类型的ID)
	NXString enumValue = enumProps->GetEnumAsString("Value");//获取零件类型的值的标签
	string a = enumValue.GetLocaleText();//获取该值
	char c_enum01[150];
	strcpy(c_enum01, a.c_str());
	char * p = (char*)a.data();//转成char类型
	value.type = UF_ATTR_string; //string类型
	value.value.string = p; //value为零件类型的值
	UF_CALL(UF_ATTR_assign(tagUnderFace, "注塑模类型", value));//为指定的对象分配属性

	enumProps = enum02->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum02[50];
	strcpy(c_enum02, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "分型面形式", value));

	enumProps = enum03->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum03[50];
	strcpy(c_enum03, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "抽芯机构", value));

	enumProps = enum04->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum04[50];
	strcpy(c_enum04, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "脱模机构", value));

	enumProps = enum05->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum05[50];
	strcpy(c_enum05, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "复位机构", value));

	enumProps = enum06->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum06[50];
	strcpy(c_enum06, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "浇口", value));

	enumProps = enum07->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum07[50];
	strcpy(c_enum07, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "温控方式", value));

	enumProps = enum08->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum08[50];
	strcpy(c_enum08, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "冷却方式", value));

	enumProps = enum010->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum010[50];
	strcpy(c_enum010, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "基本体素", value));

	enumProps = enum011->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum011[50];
	strcpy(c_enum011, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "构件类", value));

	enumProps = enum012->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum012[50];
	strcpy(c_enum012, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "绘制特征", value));

	enumProps = enum013->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum013[50];
	strcpy(c_enum013, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "位置特征", value));

	enumProps = enum018->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum018[50];
	strcpy(c_enum018, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "元截面的比例关系", value));

	enumProps = enum020->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum020[50];
	strcpy(c_enum020, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "内浇道位置", value));

	enumProps = enum021->GetProperties();
	enumValue = enumProps->GetEnumAsString("Value");
	a = enumValue.GetLocaleText();
	char c_enum021[50];
	strcpy(c_enum021, a.c_str());
	p = (char*)a.data();
	value.type = UF_ATTR_string;
	value.value.string = p;
	UF_CALL(UF_ATTR_assign(tagUnderFace, "浇注速度和温度", value));

//打开mfc设计的对话框
	WinExec("D:\\Program Files\\Siemens\\NX 10.0\\TKLTOOLS\\application\\MFCApplication1.exe", SW_SHOW);

void evaluate::showDlag()函数 // 显示与隐藏对话框中的不同栏

int enumVale = this->enum0->GetProperties()->GetEnum("Value");
	if (enumVale == 0)
	{
		this->group00->GetProperties()->SetLogical("Show", true);   //true为显示
		this->group10->GetProperties()->SetLogical("Show", true);
		this->group01->GetProperties()->SetLogical("Show", false);   //false为隐藏
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 1)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", true);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 2)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", true);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 3)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", true);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 4)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", true);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 5)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", true);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 6)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", true);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 7)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", true);
		this->group08->GetProperties()->SetLogical("Show", false);
	}
	else if (enumVale == 8)
	{
		this->group00->GetProperties()->SetLogical("Show", false);
		this->group10->GetProperties()->SetLogical("Show", false);
		this->group01->GetProperties()->SetLogical("Show", false);
		this->group02->GetProperties()->SetLogical("Show", false);
		this->group03->GetProperties()->SetLogical("Show", false);
		this->group04->GetProperties()->SetLogical("Show", false);
		this->group05->GetProperties()->SetLogical("Show", false);
		this->group06->GetProperties()->SetLogical("Show", false);
		this->group07->GetProperties()->SetLogical("Show", false);
		this->group08->GetProperties()->SetLogical("Show", true);
	}


给零件添加注塑机参数

	if (UF_CALL(UF_initialize()))
			{
				return 0;
			}
//寻找对象标签
			tag_t tagUnderFace = 0;
			std::vector<TaggedObject*>objects = this->selection0->GetProperties()->GetTaggedObjectVector("SelectedObjects");
			for (int i = 0; i<objects.size(); i++)
			{
				tagUnderFace = objects[i]->Tag();
			}

//添加属性
			UF_ATTR_value_t value;
			
			Injection *dialogInjection = new Injection(); //注塑机参数设置对话框
			dialogInjection->Show();//显示该对话框
			
			NXString str = dialogInjection->v_strValue[0];
			string a = str.GetLocaleText();
			char str0[150];
			strcpy(str0, a.c_str());
			char *p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "螺杆直径(mm)", value));


			str = dialogInjection->v_strValue[1]; //
			a = str.GetLocaleText();
			char str01[150];//
			strcpy(str01, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "螺杆长径比(L/D)", value));//

			str = dialogInjection->v_strValue[2]; //
			a = str.GetLocaleText();
			char str02[150];//
			strcpy(str02, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "螺杆压缩比", value));//

			str = dialogInjection->v_strValue[3]; //
			a = str.GetLocaleText();
			char str03[150];//
			strcpy(str03, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "螺杆行程(cm)", value));//

			str = dialogInjection->v_strValue[4]; //
			a = str.GetLocaleText();
			char str04[150];//
			strcpy(str04, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "理论注射容积(cm^3)", value));//

			str = dialogInjection->v_strValue[5]; //
			a = str.GetLocaleText();
			char str05[150];//
			strcpy(str05, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "最大注重量(g)", value));//

			str = dialogInjection->v_strValue[6]; //
			a = str.GetLocaleText();
			char str06[150];//
			strcpy(str06, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "螺杆最大转速(r/min)", value));//

			str = dialogInjection->v_strValue[7]; //
			a = str.GetLocaleText();
			char str07[150];//
			strcpy(str07, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "最大塑化能力(kg/h)", value));//

			str = dialogInjection->v_strValue[8]; //
			a = str.GetLocaleText();
			char str08[150];//
			strcpy(str08, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "注射压力(MPa)", value));//

			str = dialogInjection->v_strValue[9]; //
			a = str.GetLocaleText();
			char str09[150];//
			strcpy(str09, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "注射速度(g/s)", value));//

			str = dialogInjection->v_strValue[10]; //
			a = str.GetLocaleText();
			char str010[150];//
			strcpy(str010, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "注射时间(s)", value));//

			str = dialogInjection->v_strValue[11]; //
			a = str.GetLocaleText();
			char str011[150];//
			strcpy(str011, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "注射座推力及喷嘴推力(kN)", value));//

			str = dialogInjection->v_strValue[12]; //
			a = str.GetLocaleText();
			char str012[150];//
			strcpy(str012, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "喷嘴行程(cm)", value));//

			str = dialogInjection->v_strValue[13]; //
			a = str.GetLocaleText();
			char str013[150];//
			strcpy(str013, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "锁模力(ton)", value));//

			str = dialogInjection->v_strValue[14]; //
			a = str.GetLocaleText();
			char str014[150];//
			strcpy(str014, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "最大容模量(mm)", value));//

			str = dialogInjection->v_strValue[15]; //
			a = str.GetLocaleText();
			char str015[150];//
			strcpy(str015, a.c_str());//
			p = (char*)a.data();
			value.type = UF_ATTR_string;
			value.value.string = p;
			UF_CALL(UF_ATTR_assign(tagUnderFace, "开模行程(mm)", value));//
			delete dialogInjection;
			delete p;

2、方案推荐代码

对话框设计同第二步

只添加了打开mfc的函数

	#include   "windows.h "                                   //需要该头文件
	WinExec("D:\\Program Files\\Siemens\\NX 10.0\\TKLTOOLS\\application\\MFCApplication1.exe", SW_SHOW);

3、知识检索与知识索引没有设计对话框,知识添加了打开mfc对话框的函数

#include   "windows.h "                                   //需要该头文件
WinExec("D:\\Program Files\\Siemens\\NX 10.0\\TKLTOOLS\\application\\MFCApplication1.exe", SW_SHOW);

4、mfc对话框只添加了打开网址的控件

五、将设计的对话框添加到ug

1、将所写vs项目,生成为dll文件

2、在Program Files\Siemens\NX 10.0\TKLTOOLS目录下创建”application“文件夹

3、将第二部中生成的dlx文件和vs生成的dll文件保存到该文件夹下

4、在第一步,在每个子菜单对应的按钮中添加dll文件名,例:在ACTIONS后添加文件名

BUTTON 111  						 //定义第一个按钮的ID
LABEL 知识检索  					  //标签名字(显示的名字)
BITMAP       						 //可以添加图案
ACTIONS webjiansuo 					 //需要链接的dll文件名(dll文件为点击该按钮后弹出的对话框)
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值