📄 samp3.c
字号:
pro_e_std_feature_name );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_POINTS_ARRAY *** " );
status = ProElementAlloc ( PRO_E_DPOINT_POINTS_ARRAY,
&pro_e_dpoint_points_array );
status = ProElemtreeElementAdd ( pro_e_feature_tree, NULL,
pro_e_dpoint_points_array );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_POINT *** " );
status = ProElementAlloc ( PRO_E_DPOINT_POINT, &pro_e_dpoint_point );
status = ProElemtreeElementAdd ( pro_e_dpoint_points_array, NULL,
pro_e_dpoint_point );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_POINT_NAME
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_POINT_NAME *** " );
status = ProElementAlloc ( PRO_E_DPOINT_POINT_NAME, &pro_e_dpoint_point_name );
ProStringToWstring ( wide_string, "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_dpoint_point_name, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_point, NULL,
pro_e_dpoint_point_name );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTRAINTS *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTRAINTS,
&pro_e_dpoint_pla_constraints );
status = ProElemtreeElementAdd ( pro_e_dpoint_point, NULL,
pro_e_dpoint_pla_constraints );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTRAINT *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTRAINT,
&pro_e_dpoint_pla_constraint );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraints, NULL,
pro_e_dpoint_pla_constraint );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_REF
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_REF *** " );
status = ProMessageDisplay ( UserMsg, "Select a reference Surface");
printf ( "Please select datum,surface,sldface,qltface_ID_5 type of Modelitem\n");
status = ProSelect ( "datum,surface,sldface,qltface", -1, NULL, NULL,
NULL, NULL, &p_select, &n_select );
if ( n_select <= 0 ) return -1;
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_REF,
&pro_e_dpoint_pla_constr_ref );
value_data.type = PRO_VALUE_TYPE_SELECTION;
value_data.v.r = p_select[0];
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_ref, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_ref );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_TYPE
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_TYPE *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_TYPE,
&pro_e_dpoint_pla_constr_type );
value_data.type = PRO_VALUE_TYPE_INT;
value_data.v.i = PRO_DTMPNT_CONSTR_TYPE_ON; /* 0 ProDtmpntConstrType */
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_type, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_type );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_VAL
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_VAL *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_VAL, &pro_e_dpoint_pla_constr_val );
value_data.type = PRO_VALUE_TYPE_DOUBLE;
value_data.v.d = 0.000000;
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_val, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_val );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTRAINT *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTRAINT,
&pro_e_dpoint_pla_constraint );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraints, NULL,
pro_e_dpoint_pla_constraint );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_REF
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_REF *** " );
status = ProMessageDisplay ( UserMsg, "Select a reference Surface");
printf ( "Please select datum,surface,sldface,qltface_ID_5 type of Modelitem\n");
status = ProSelect ( "datum,surface,sldface,qltface", -1, NULL, NULL,
NULL, NULL, &p_select, &n_select );
if ( n_select <= 0 ) return -1;
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_REF,
&pro_e_dpoint_pla_constr_ref );
value_data.type = PRO_VALUE_TYPE_SELECTION;
value_data.v.r = p_select[0];
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_ref, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_ref );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_TYPE
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_TYPE *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_TYPE,
&pro_e_dpoint_pla_constr_type );
value_data.type = PRO_VALUE_TYPE_INT;
value_data.v.i = PRO_DTMPNT_CONSTR_TYPE_ON; /* 0 ProDtmpntConstrType */
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_type, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_type );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_VAL
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_VAL *** " );
status = ProElementAlloc (PRO_E_DPOINT_PLA_CONSTR_VAL,
&pro_e_dpoint_pla_constr_val );
value_data.type = PRO_VALUE_TYPE_DOUBLE;
value_data.v.d = 0.000000;
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_val, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_val );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTRAINT *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTRAINT,
&pro_e_dpoint_pla_constraint );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraints, NULL,
pro_e_dpoint_pla_constraint );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_REF
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_REF *** " );
status = ProMessageDisplay ( UserMsg, "Select a reference Surface");
printf ( "Please select datum,surface,sldface,qltface_ID_5 type of Modelitem\n");
status = ProSelect ( "datum,surface,sldface,qltface", -1, NULL, NULL,
NULL, NULL, &p_select, &n_select );
if ( n_select <= 0 ) return -1;
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_REF,
&pro_e_dpoint_pla_constr_ref );
value_data.type = PRO_VALUE_TYPE_SELECTION;
value_data.v.r = p_select[0];
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_ref, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_ref );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_TYPE
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_TYPE *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_TYPE,
&pro_e_dpoint_pla_constr_type );
value_data.type = PRO_VALUE_TYPE_INT;
value_data.v.i = PRO_DTMPNT_CONSTR_TYPE_ON; /* 0 ProDtmpntConstrType */
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_type, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_type );
/*---------------------------------------------------------------*\
Populating element PRO_E_DPOINT_POINTS_ARRAY
-> PRO_E_DPOINT_POINT
-> PRO_E_DPOINT_PLA_CONSTRAINTS
-> PRO_E_DPOINT_PLA_CONSTRAINT
-> PRO_E_DPOINT_PLA_CONSTR_VAL
\*---------------------------------------------------------------*/
C_PRINT( " *** Processing Element PRO_E_DPOINT_PLA_CONSTR_VAL *** " );
status = ProElementAlloc ( PRO_E_DPOINT_PLA_CONSTR_VAL,
&pro_e_dpoint_pla_constr_val );
value_data.type = PRO_VALUE_TYPE_DOUBLE;
value_data.v.d = 0.000000;
status = ProValueAlloc ( &value );
status = ProValueDataSet ( value, &value_data );
status = ProElementValueSet ( pro_e_dpoint_pla_constr_val, value );
status = ProElemtreeElementAdd ( pro_e_dpoint_pla_constraint, NULL,
pro_e_dpoint_pla_constr_val );
/*---------------------------------------------------------------*\
Create the feature in the current model.
\*---------------------------------------------------------------*/
status = ProMdlCurrentGet (&model);
if ( status != PRO_TK_NO_ERROR ) return ( status );
status = ProMdlToModelitem( model, &model_item );
status = ProSelectionAlloc (p_comp_path, &model_item,
&model_sel);
opts[0] = PRO_FEAT_CR_DEFINE_MISS_ELEMS;
status = ProFeatureCreate (model_sel, pro_e_feature_tree, opts, 1,
&feature, &errors);
status = ProElementFree (&pro_e_feature_tree );
return (status);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -