PLM之家PLMHome-国产软件践行者

[交作业] 第二节课作业

[复制链接]

2015-4-18 21:23:44 2789 1

JIN519820XX 发表于 2015-4-18 15:26:04 |阅读模式

JIN519820XX 楼主

2015-4-18 15:26:04

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
tag_t part_tag=NULL_TAG;+ c" M, _" [: p6 F
double originPoint[3]={0.0,0.0,0.0};' S& R) ^5 O; ?8 R! V  V. t3 }
char* cyHeight="200";
2 \! R, P+ r8 y5 R! ]char* cyDiam="60";
) |9 l( B' L; Ddouble cyDirection[3]={0.0,0.0,1.0};
. N; r- W# M. ]! M4 N" r9 dtag_t cy_tag=NULL_TAG;# {4 r. |9 C" C3 n4 W( W+ a

% R1 \, _% C+ k  \: v! X- J  uUF_CURVE_line_t lineCoords;1 x7 y$ Q  j! P! p
tag_t lineTage=NULL_TAG;7 |& {# ?: @4 {& n2 t
double endPoint[3]={0.0,0.0,200.0};
: {2 Y; ]% x0 O9 t$ O( B8 V
% p7 N# F& q% E. V% Ochar  msg[256];
- o! h+ }: ]5 q5 R$ e5 Q) p5 d( gdouble lineStartPoint[3];! M* e+ A7 G- L
double lineEndPoint[3];
- e( @- _- m" A/ P0 _5 H
# D' z* a8 C5 ~9 Uextern DllExport void ufusr( char *parm, int *returnCode, int rlen )0 c% i  K4 L' ^* F% H9 ?2 a
{
  ?$ G; [/ }! I/ c  /* Initialize the API environment */! c# e% o' k, J% M% K3 R
    if( UF_CALL(UF_initialize()) )
( u; n* L' w$ B2 |    {& X* H: @) o  V
; y& N8 D9 Y& R8 |) _
        /* Failed to initialize */
+ _% g- X+ d6 V. h         return;/ G( f+ u$ D6 W( R0 B
    }
& b: k$ H( Z0 W+ j) Y4 g  / K8 d2 h& \$ l3 C* g; j: ?1 _
   /* TODO: Add your application code here */' y) y. f4 j1 V3 f7 d2 Z
      UF_PART_new("D:\plmpart.prt",1,&part_tag);
4 S+ K0 I& `4 c' R     UF_MODL_create_cyl1(UF_NULLSIGN,originPoint,cyHeight,cyDiam,cyDirection,&cy_tag);: M1 x* M- Q9 \2 t* r9 D" U! u
     lineCoords.start_point[0]=originPoint[0];
0 T8 H5 l- ~( o5 r$ n0 K     lineCoords.start_point[1]=originPoint[1];
; i; R! A8 f8 Y* }( ]8 f# O  f     lineCoords.start_point[2]=originPoint[2];# H9 P) O; e5 H( R, W
' c, G, {6 v7 Q7 m3 f, h
    lineCoords.end_point[0]=endPoint[0];
& V# V9 R7 J% ]+ I% G3 g! K1 G9 ^    lineCoords.end_point[1]=endPoint[1];
. \) [5 M2 v0 b0 j    lineCoords.end_point[2]=endPoint[2];
9 }  ?5 K4 u# U3 v    UF_CURVE_create_line(&lineCoords,&lineTage);$ {; U! M! O5 ]: ~
    UF_CURVE_ask_line_data(lineTage,&lineCoords);3 p5 M. a9 x% P+ `
    lineStartPoint[0]=lineCoords.start_point[0];
6 k  {8 \# \: D6 b$ D' X   lineStartPoint[1]=lineCoords.start_point[1];
; U, |, {1 w& f9 S3 ~! N   lineStartPoint[2]=lineCoords.start_point[2];3 J$ b. T  p  k4 c/ C
   lineEndPoint[0]=lineCoords.end_point[0];
9 T, N0 S2 c8 \8 B+ l   lineEndPoint[1]=lineCoords.end_point[1];2 }" K& ^$ r; ~! J+ S
   lineEndPoint[2]=lineCoords.end_point[2];* r3 [3 G% M0 K, W' b
   sprintf(msg,"起始点:X:%f,Y:%f,Z:%f",lineStartPoint[0],lineStartPoint[1],lineStartPoint[2]);
+ u: \& N  Q# }! Z0 S   uc1601(msg,1);
( U( ]( w7 {. b  Q& M   sprintf(msg,"终点:X:%f,Y:%f,Z:%f",endPoint[0],endPoint[1],endPoint[2]);
% w7 ^, `. r4 d! J; p0 N( t% N   uc1601(msg,1);
4 o6 O% O/ z6 X* ]! D/ C   UF_PART_save();
0 c! y9 W9 d2 D' S3 S0 M  P   UF_PART_close_all();
! P& g: K4 w/ N+ X3 \    /* Terminate the API environment */' x1 u# B- n, ?0 P4 \- S4 P( V
  UF_CALL(UF_terminate());
' ^( A0 n. L. U. u! J}' y% z# Z! f1 f4 H$ M$ O
0 E! }: k+ X: r& T5 s2 F

+ }) Y. I& L9 p. i: D, ~6 s9 N+ z/ L6 @" b/ Y/ u- K( i& e# c7 R

评分

参与人数 1PLM币 +5 收起 理由
admin + 5 很给力!

查看全部评分

上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

全部回复1

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了