学NX二次开发就上UG网:
创建管道UF函数: UF_MODL_create_trimmed_tube();本例演示的先创建一条直线,然后使用这条直线来创建管道;
UG管道
UG二次开发创建管道C++源代码:
- /*中磊国际模具培训-创建管道功能*/
-
- int obj_count;
- char*body_limit[2] = { "outer_diameter=4.0", "inner_diameter=0.0" };
- tag_t generators[2], line1, line2, *objects;
- UF_MODL_SWEEP_TRIM_object_p_t trim_data = NULL;
- UF_CURVE_line_t sline1, sline2;
- UF_FEATURE_SIGN mode_sign = UF_NULLSIGN;
- /* line#1 */
- sline1.start_point[0] = 0.0;
- sline1.start_point[1] = 0.0;
- sline1.start_point[2] = 0.0;
- sline1.end_point[0] = 0.0;
- sline1.end_point[1] = 10.0;
- sline1.end_point[2] = 0.0;
- UF_CURVE_create_line(&sline1, &line1);
- /* line#2 */
- sline2.start_point[0] = 0.0;
- sline2.start_point[1] = 10.0;
- sline2.start_point[2] = 0.0;
- sline2.end_point[0] = 25;
- sline2.end_point[1] = 35;
- sline2.end_point[2] = 0.0;
- UF_CURVE_create_line(&sline2, &line2);
- generators[0] = line1;
- generators[1] = line2;
- UF_MODL_create_trimmed_tube(generators, 2, trim_data,body_limit,mode_sign, &objects, &obj_count);
复制代码
|