• 大小: 8.76MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-24
  • 语言: C/C++
  • 标签: UG  二次开发  

资源简介

改资源属于UG的二次开发C++内容,喜欢的请支持下载。里面代码内容还蛮全的

资源截图

代码片段和文件信息

#include “stdafx.h“
#include “Main.h“

extern “C“ DllExport void ufsta(char *paramint *returnCode int rlen)
{
if((UF_initialize())!=0) return;

int iModuleId;
UF_ask_application_module(&iModuleId);
if (UF_APP_CAM!=iModuleId)
{
uc1601(“请在加工模块下使用!“1);
return;
}

char ctitle[81]=“请选择操作“;
int iDefaultItem=1;
char cItems[2][38]={“创建程序组““更名程序组“};
int iNumItems=2;
int iRes=uc1603 (ctitleiDefaultItemcItemsiNumItems);
switch(iRes)
{
case 1:
return;
break;
case 2:
return;
    break;
case 5:
CreateProgram();
break;
case 6:
ReNameProgram();
    break;
default:
    break;
}

UF_terminate();
return;
}

int ufusr_ask_unload(void)
{
return(UF_UNLOAD_IMMEDIATELY);
}

void CreateProgram()
{
char cItem[3][16]={“主名““起始编号““结束编号“};
int iNum=3;
int iValve[3]={019};
double dValve[3];
char cValve[3][31]={“AA““1““9“};
int iType[3]={300300300};
int i1613Res=uc1613(“输入程序组名称“cItemiNumiValvedValvecValveiType);
if (1==i1613Res||2==i1613Res)
{
return;
}

tag_t tSetup=NULL_TAG;
tag_t tNewobject=NULL_TAG;
tag_t tRootProgram;
char cTypeName[200]=“mill_contour“;
char cSubtypeName[200]=“PROGRAM“;
char cProgramName[UF_OBJ_NAME_LEN+1];
tag_t tProgram=NULL_TAG;

UF_SETUP_ask_setup(&tSetup);
UF_SETUP_ask_program_root(tSetup&tRootProgram);
UF_NCGROUP_ask_object_of_name (tRootProgram“PROGRAM“&tProgram);

int iStringLen1=strlen(cValve[1]);
int iStringLen2=strlen(cValve[2]);
int i=0;
if ((1==iStringLen1&&isalpha(cValve[1][0]))&&
(1==iStringLen2&&isalpha(cValve[2][0])))
{
for (i=0;i<(cValve[2][0]-cValve[1][0]+1);i++)
{
sprintf(cProgramName“%s%c“cValve[0]cValve[1][0]+i);
UF_NCPROG_create(cTypeNamecSubtypeName&tNewobject);
UF_OBJ_set_name(tNewobjectcProgramName);
UF_NCGROUP_accept_member(tProgramtNewobject);
}
}

if (iStringLen1>1||
iStringLen2>1||
((1==iStringLen1&&isdigit(cValve[1][0]))&&
(1==iStringLen2&&isdigit(cValve[2][0]))))
{
for (i=0;i {
if(!isdigit(cValve[1][i]))
{
uc1601(“请输入正确的起始编号可以输入数字和字母如果是字母则只能输入一个字母!“1);
return;
}
}
for (i=0;i {
if(!isdigit(cValve[2][i]))
{
uc1601(“请输入正确的结束编号可以输入数字和字母如果是字母则只能输入一个字母!“1);
return;
}
}

int iStartNumber=atoi(cValve[1]);
int iEndNumber=atoi(cValve[2]);
for (i=0;i<(iEndNumber-iStartNumber+1);i++)
{
sprintf(cProgramName“%s%d“cValve[0]iStartNumber+i);
UF_NCPROG_create(cTypeNamecSubtypeName&tNewobject);
UF_OBJ_set_name(tNewobjectcProgramName);
UF_NCGROUP_accept_member(tProgramtNewobject);
}
}

UF_UI_ONT_refresh();
UF_UI_ONT_expand_view();
}

void ReNameProgram()
{
int i=0;
int iSelRes;
int iSelCount=0;
tag_p_t tSelOject;
tag_t *tNodeobject;
int iNodeCount=0;
UF_UI_ONT_ask_selected_nodes(&iNodeCount&tNodeobject);
if (0==iNodeCount)
{
UF_UI_select_w

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      44382  2007-12-03 20:17  nc_program\Debug\main.obj

     文件          0  2007-12-03 20:17  nc_program\Debug\main.sbr

     文件    5760000  2007-12-03 20:17  nc_program\Debug\nc_program.bsc

     文件        744  2007-12-03 19:21  nc_program\Debug\nc_program.exp

     文件       2162  2007-12-03 19:21  nc_program\Debug\nc_program.lib

     文件      10141  2007-12-02 11:45  nc_program\Debug\nc_program.obj

     文件    8538620  2007-12-02 11:45  nc_program\Debug\nc_program.pch

     文件    2761728  2007-12-03 20:17  nc_program\Debug\nc_program.pdb

     文件       6880  2007-12-02 11:42  nc_program\Debug\nc_program.res

     文件          0  2007-12-02 11:45  nc_program\Debug\nc_program.sbr

     文件     117623  2007-12-02 11:45  nc_program\Debug\StdAfx.obj

     文件    1666681  2007-12-02 11:45  nc_program\Debug\StdAfx.sbr

     文件      35131  2007-12-02 14:20  nc_program\Debug\uf_call.obj

     文件          0  2007-12-02 14:20  nc_program\Debug\uf_call.sbr

     文件     336896  2007-12-03 20:17  nc_program\Debug\vc60.idb

     文件     569344  2007-12-03 20:17  nc_program\Debug\vc60.pdb

     文件       6058  2009-05-17 11:51  nc_program\main.cpp

     文件        617  2007-12-02 14:20  nc_program\main.h

     文件        346  2007-12-02 11:41  nc_program\nc_program.clw

     文件       1787  2007-12-02 11:41  nc_program\nc_program.cpp

     文件        201  2007-12-02 11:41  nc_program\nc_program.def

     文件       4880  2012-12-18 00:05  nc_program\nc_program.dsp

     文件        526  2007-12-02 11:41  nc_program\nc_program.dsw

     文件       1312  2007-12-02 11:41  nc_program\nc_program.h

     文件      91136  2012-12-18 00:05  nc_program\nc_program.ncb

     文件      56832  2012-12-18 00:05  nc_program\nc_program.opt

     文件       2333  2012-12-18 00:04  nc_program\nc_program.plg

     文件       3109  2007-12-02 11:41  nc_program\nc_program.rc

     文件       2631  2007-12-02 11:41  nc_program\ReadMe.txt

     文件      10739  2012-12-18 00:04  nc_program\Release\main.obj

............此处省略27个文件信息

评论

共有 条评论