NX9+VS2012

     #include <uf.h>
#include <uf_curve.h>
#include <uf_modl.h> UF_initialize(); //圆心点
double p1[] = {0.0, 0.0, 0.0};
tag_t CenterTag = NULL_TAG;
UF_CURVE_create_point(p1, &CenterTag); //辅助点
double HelpPoint[] = {100.0, 0.0, 0.0};
tag_t HelpPointTag = NULL_TAG;
UF_CURVE_create_point(HelpPoint, &HelpPointTag); //类型
UF_CURVE_limit_t limit[];
UF_CURVE_limit_p_t pLimit[] = { &limit[], &limit[] };
limit[].limit_type = UF_CURVE_limit_value;
limit[].value = ;//按值
limit[].limit_type = UF_CURVE_limit_value;
limit[].value = ;//按值 //创建XZ基准平面,用来放圆弧
double PlanePoint[] = { 0.0, 0.0, 0.0 };
double Direction1[] = { 1.0, 0.0, 0.0 };
tag_t DplaneTag = NULL_TAG;
UF_MODL_create_fixed_dplane(PlanePoint, Direction1, &DplaneTag); tag_t ArcTag = NULL_TAG;
UF_CURVE_create_arc_center_radius(CenterTag, , HelpPointTag, pLimit, DplaneTag, FALSE, &ArcTag); //创建直线
UF_CURVE_line_t LineCoods1;
LineCoods1.start_point[] = 0.0;
LineCoods1.start_point[] = 0.0;
LineCoods1.start_point[] = 0.0;
LineCoods1.end_point[] = 0.0;
LineCoods1.end_point[] = 100.0;
LineCoods1.end_point[] = 0.0;
tag_t Line1Tag = NULL_TAG;
UF_CURVE_create_line(&LineCoods1, &Line1Tag); UF_CURVE_line_t LineCoods2;
LineCoods2.start_point[] = 0.0;
LineCoods2.start_point[] = 0.0;
LineCoods2.start_point[] = 0.0;
LineCoods2.end_point[] = 0.0;
LineCoods2.end_point[] = 0.0;
LineCoods2.end_point[] = -100.0;
tag_t Line2Tag = NULL_TAG;
UF_CURVE_create_line(&LineCoods2, &Line2Tag); //创建旋转
uf_list_p_t EdgeLits;
UF_MODL_create_list(&EdgeLits);//创建链表
UF_MODL_put_list_item(EdgeLits, Line1Tag);//Tag添加到链表
UF_MODL_put_list_item(EdgeLits, Line2Tag);
UF_MODL_put_list_item(EdgeLits, ArcTag); char *Limit[] = { "0.0", "360.0" };
double Point1[] = { 0.0, 0.0, 0.0 };
double Direction[] = { 0.0, 0.0, 1.0 };
UF_FEATURE_SIGN Sign = UF_NULLSIGN;
uf_list_p_t FeatureList;
UF_MODL_create_revolved(EdgeLits, Limit, Point1, Direction, Sign, &FeatureList); UF_MODL_delete_list(&FeatureList);//删除链表
UF_MODL_delete_list(&EdgeLits); UF_terminate();

NX二次开发-创建旋转UF_MODL_create_revolved-LMLPHP

05-21 05:39