⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samp3.c

📁 Pro.TOOLKIT.Wildfire插件设计.配套光盘-141M.zip
💻 C
📖 第 1 页 / 共 2 页
字号:

/*load head file*/
#include<ProToolkit.h>#include<Pro2dEntdef.h>#include<ProANSI.h>#include<ProAnimate.h>#include<ProArray.h>#include<ProAsmcomp.h>#include<ProAsmcomppath.h>#include<ProAssembly.h>#include<ProAxis.h>#include<ProChamfer.h>#include<ProClCmd.h>#include<ProColor.h>#include<ProComm.h>#include<ProConst.h>#include<ProContour.h>#include<ProContourdata.h>#include<ProCore.h>#include<ProCsys.h>#include<ProCsysdata.h>#include<ProCurve.h>#include<ProCurvedata.h>#include<ProDatumdata.h>#include<ProDisplist.h>#include<ProDtmAxis.h>#include<ProDtmCrv.h>#include<ProDtmCrvSketch.h>#include<ProDtmCsys.h>#include<ProDtmPln.h>#include<ProEdge.h>#include<ProEdgedata.h>#include<ProElemId.h>#include<ProElement.h>#include<ProElempath.h>#include<ProExpldstate.h>#include<ProExtdata.h>#include<ProExtobj.h>#include<ProExtobjCB.h>#include<ProExtobjDisp.h>#include<ProExtobjRef.h>#include<ProExtobjSel.h>#include<ProExtrude.h>#include<ProFaminstance.h>#include<ProFamtable.h>#include<ProFeatForm.h>#include<ProFeatType.h>#include<ProFeature.h>#include<ProFixture.h>#include<ProFlatSrf.h>#include<ProForeignCurve.h>#include<ProGeomitem.h>#include<ProGeomitemdata.h>#include<ProGraphic.h>#include<ProGroup.h>#include<ProHardware.h>#include<ProImportfeat.h>#include<ProIntfData.h>#include<ProItemerr.h>#include<ProLayer.h>#include<ProLayerR19.h>#include<ProMaterial.h>#include<ProMdl.h>#include<ProMenu.h>#include<ProMenuBar.h>#include<ProMessage.h>#include<ProMfg.h>#include<ProMfgoper.h>#include<ProModFeat.h>#include<ProMode.h>#include<ProModelitem.h>#include<ProNcseq.h>#include<ProNcseqElem.h>#include<ProNote.h>#include<ProNotify.h>#include<ProObjects.h>#include<ProParameter.h>#include<ProParamval.h>#include<ProPart.h>#include<ProPattern.h>#include<ProPecktable.h>#include<ProPoint.h>#include<ProProcstep.h>#include<ProQuilt.h>#include<ProQuiltdata.h>#include<ProRelSet.h>#include<ProReplace.h>#include<ProRevolve.h>#include<ProRmdt.h>#include<ProRule.h>#include<ProSecConstr.h>#include<ProSecdim.h>#include<ProSecdimType.h>#include<ProSecerror.h>#include<ProSection.h>#include<ProSelection.h>#include<ProSheetmetal.h>#include<ProSimprep.h>#include<ProSimprepdata.h>#include<ProSizeConst.h>#include<ProSolid.h>#include<ProStdSection.h>#include<ProSurface.h>#include<ProSurfacedata.h>#include<ProSweep.h>#include<ProTool.h>#include<ProToolElem.h>#include<ProToolinput.h>#include<ProUICmd.h>#include<ProUtil.h>#include<ProValue.h>#include<ProVerstamp.h>#include<ProView.h>#include<ProWcell.h>#include<ProWchar.h>#include<ProWindows.h>#include<ProWorkspace.h>#include<ProWstring.h>#include "ProDtmPnt.h"



#define C_PRINT(a) printf ( "%s\n", a);

 ProFileName   UserMsg;

/*---------------------- Function Prototypes -------------------------*/
 ProError ProDemoGeneralPointCreate();
/*--------------------------------------------------------------------*\Application global data\*--------------------------------------------------------------------*/static uiCmdAccessState TestAccessDefault(uiCmdAccessMode access_mode){    return (ACCESS_AVAILABLE);}/*===========================================================================*\  Function : main  Purpose  : Test the ProToolkitMain() function. main is optional function.\*===========================================================================*/main(argc, argv)int  argc;char **argv;{    ProToolkitMain(argc, argv);    return(0);}/*====================================================================*\FUNCTION : user_initialize()PURPOSE  : Pro/DEVELOP standard initialize - define menu button\*====================================================================*/int user_initialize(    int argc,			    char *argv[],    wchar_t errbuf[80]){
    int i, menu_id;
    ProError status;
    uiCmdCmdId	cmd_id;

	/*----------------------------------------------------------------*\
	消息文件
	\*----------------------------------------------------------------*/
	ProStringToWstring (UserMsg, "msg.txt");
	status = ProMessageDisplay (UserMsg, "USER %0s", "Demo of creating general datum point.\n");

	/*---------------------------------------------------------------------*\
	    Add new button to the menu bar
	\*---------------------------------------------------------------------*/
    status = ProCmdActionAdd("MyCmd",
	(uiCmdCmdActFn)ProDemoGeneralPointCreate,
	uiProe2ndImmediate, TestAccessDefault,
	PRO_B_TRUE, PRO_B_TRUE, &cmd_id);

    status = ProMenubarmenuPushbuttonAdd(
	"File", "MyCmd", "Create Datum Point", "Create Datum Point",
	"File.psh_exit", PRO_B_TRUE, cmd_id, UserMsg);

    return (0);

}

/*====================================================================*\
FUNCTION : user_terminate()
PURPOSE  : To handle any termination actions
\*====================================================================*/
void user_terminate()
{

}


/*===============================================================*\
FUNCTION : ProDemoGeneralPointCreate
PURPOSE  : Demonstrates the creation of the General Datum Point
\*===============================================================*/
 ProError ProDemoGeneralPointCreate()
{
  ProErrorlist            errors;
  ProMdl                  model;
  ProModelitem            model_item;
  ProSelection            model_sel;
  ProFeature              feature;
  ProFeatureCreateOptions opts[1];
  ProAsmcomppath          *p_comp_path = NULL;
  ProValue                value;
  char                    name[PRO_NAME_SIZE];
  ProError                  status;
  

  ProElement pro_e_feature_tree;
  ProElement pro_e_feature_type;
  ProElement pro_e_dpoint_type;
  ProElement pro_e_std_feature_name;
  ProElement pro_e_dpoint_points_array;
  ProElement pro_e_dpoint_point;
  ProElement pro_e_dpoint_point_name;
  ProElement pro_e_dpoint_pla_constraints;
  ProElement pro_e_dpoint_pla_constraint;
  ProElement pro_e_dpoint_pla_constr_ref;
  ProElement pro_e_dpoint_pla_constr_type;
  ProElement pro_e_dpoint_pla_constr_val;
  
  ProName       wide_string;
  ProValueData  value_data;
  ProSelection * p_select;
  int           n_select;
  ProBoolean    is_interactive = PRO_B_TRUE;
  
    
/*---------------------------------------------------------------*\
    Populating root element PRO_E_FEATURE_TREE 
\*---------------------------------------------------------------*/
 C_PRINT( " *** Processing Element PRO_E_FEATURE_TREE *** " );
 status = ProElementAlloc ( PRO_E_FEATURE_TREE, &pro_e_feature_tree ); 
  
/*---------------------------------------------------------------*\
    Populating element PRO_E_FEATURE_TYPE 
\*---------------------------------------------------------------*/
 C_PRINT( " *** Processing Element PRO_E_FEATURE_TYPE *** " );
 status = ProElementAlloc ( PRO_E_FEATURE_TYPE, &pro_e_feature_type );
 value_data.type = PRO_VALUE_TYPE_INT;
 value_data.v.i = PRO_FEAT_DATUM_POINT; /* 931 */ 
 status = ProValueAlloc ( &value );
 status = ProValueDataSet ( value, &value_data );
 status = ProElementValueSet ( pro_e_feature_type, value );
 status = ProElemtreeElementAdd ( pro_e_feature_tree, NULL, 
                                  pro_e_feature_type );

/*---------------------------------------------------------------*\
   Populating element PRO_E_DPOINT_TYPE
\*---------------------------------------------------------------*/
 C_PRINT( " *** Processing Element PRO_E_DPOINT_TYPE *** " );
 status = ProElementAlloc ( PRO_E_DPOINT_TYPE, &pro_e_dpoint_type );
 value_data.type = PRO_VALUE_TYPE_INT;
 value_data.v.i = PRO_DPOINT_TYPE_GENERAL; /* -1 */ 
 status = ProValueAlloc ( &value );
 status = ProValueDataSet ( value, &value_data );
 status = ProElementValueSet ( pro_e_dpoint_type, value );
 status = ProElemtreeElementAdd ( pro_e_feature_tree, NULL,
                                  pro_e_dpoint_type );
  
  /*---------------------------------------------------------------*\
    Populating element PRO_E_STD_FEATURE_NAME
  \*---------------------------------------------------------------*/
  C_PRINT( " *** Processing Element PRO_E_STD_FEATURE_NAME *** " );
  status = ProElementAlloc ( PRO_E_STD_FEATURE_NAME,
                             &pro_e_std_feature_name ); 
  ProStringToWstring ( wide_string, "MY_PNT0" );
  value_data.type = PRO_VALUE_TYPE_WSTRING;
  value_data.v.w = wide_string;
  status = ProValueAlloc ( &value );
  status = ProValueDataSet ( value, &value_data );
  status = ProElementValueSet ( pro_e_std_feature_name, value );
  status = ProElemtreeElementAdd ( pro_e_feature_tree, NULL,

⌨️ 快捷键说明

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