PLM之家PLMHome-工业软件践行者

[交作业] 第二节课作业

[复制链接]

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

2

主题

0

回帖

47

积分

培训VIP会员

积分
47
发表于 2015-4-18 15:26:04 | 显示全部楼层 |阅读模式

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

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

x
tag_t part_tag=NULL_TAG;
6 F$ P( J+ Q9 \& B3 Q$ w4 n* N# \double originPoint[3]={0.0,0.0,0.0};0 i+ T" y+ W1 X/ c; q0 C7 g" H
char* cyHeight="200";! r0 b1 V$ R, v5 p* r6 D
char* cyDiam="60";9 p4 X) \0 z# {8 Z5 @, W! e  O
double cyDirection[3]={0.0,0.0,1.0};
4 h% r3 ?# P: d2 V$ R, v/ _2 O& Z) Vtag_t cy_tag=NULL_TAG;
& w- E* A! ]! e
( a; T% m8 g: ~) d/ X8 z3 P7 y* pUF_CURVE_line_t lineCoords;3 h) H7 D: g2 A
tag_t lineTage=NULL_TAG;8 W* P6 z  N6 i
double endPoint[3]={0.0,0.0,200.0};* q  V# t: L7 P* o

0 D3 S+ @: \8 P( Fchar  msg[256];/ u  f2 v. ]$ C# P
double lineStartPoint[3];' e* m! j+ s/ z' @
double lineEndPoint[3];, i, h! b7 d( i/ f

0 h+ R, Z! P$ J7 d# N1 iextern DllExport void ufusr( char *parm, int *returnCode, int rlen )
% K! U& M* b% {; X- h* |- l{8 m$ r$ A+ A7 X! F( A& R' ^
  /* Initialize the API environment */
  A% w" Q( X  a    if( UF_CALL(UF_initialize()) )
; W* F  y% w- @" Q6 U. @. {6 Y    {6 {! Y& @$ p$ G  Q( l$ N; [- _
0 n' ]; v: u: o1 V; b& P
        /* Failed to initialize */: h8 m) g: g: z. i; e1 @
         return;
3 F9 T0 d: y4 f' F4 K! T- I! J8 ~    }
( I& W/ j# e) U2 ~! x5 z  7 ?9 P; a0 r& k4 i/ p
   /* TODO: Add your application code here */
/ D0 L- \4 w: W% J8 b      UF_PART_new("D:\plmpart.prt",1,&part_tag);- ?6 N; l+ @5 P0 p1 V8 Z( R
     UF_MODL_create_cyl1(UF_NULLSIGN,originPoint,cyHeight,cyDiam,cyDirection,&cy_tag);
7 d4 i7 \; X" V  L( n5 M0 N     lineCoords.start_point[0]=originPoint[0];  M/ `+ ~; `) P6 ~; x# V
     lineCoords.start_point[1]=originPoint[1];
' G; e# ~7 c0 Q! {: S) C  x/ c     lineCoords.start_point[2]=originPoint[2];
' s& D5 j. N5 J# M: S5 ]2 B
2 T# K- ?/ `/ q& i4 h- b* y    lineCoords.end_point[0]=endPoint[0];0 J; i% m* a& H$ _) h" Z
    lineCoords.end_point[1]=endPoint[1];/ b) F0 H5 H8 ]0 ^( j! R) G
    lineCoords.end_point[2]=endPoint[2];5 [# I" V2 w# C
    UF_CURVE_create_line(&lineCoords,&lineTage);
7 A, A/ Q+ ^  @' [, m% a7 ]& b) v    UF_CURVE_ask_line_data(lineTage,&lineCoords);
9 j5 m+ p& g4 I, X- p    lineStartPoint[0]=lineCoords.start_point[0];) x, c% {) T+ f! f# b
   lineStartPoint[1]=lineCoords.start_point[1];
& p' c8 E8 W" a+ m   lineStartPoint[2]=lineCoords.start_point[2];
1 g( r9 g; G  p" b. _! |0 H0 |& m5 J   lineEndPoint[0]=lineCoords.end_point[0];
7 P% P2 ^2 {, m0 z: n4 E% Y   lineEndPoint[1]=lineCoords.end_point[1];
+ r( p" ~7 ~  s   lineEndPoint[2]=lineCoords.end_point[2];; V$ |+ v! {8 f, o; Z
   sprintf(msg,"起始点:X:%f,Y:%f,Z:%f",lineStartPoint[0],lineStartPoint[1],lineStartPoint[2]);
- ^4 T/ {* x5 s1 ^; G! I* t- i   uc1601(msg,1);# B$ a: s' p* V" [4 {" f# t
   sprintf(msg,"终点:X:%f,Y:%f,Z:%f",endPoint[0],endPoint[1],endPoint[2]);
7 g% ^/ d% Q' a3 u3 h6 |  }   uc1601(msg,1);
+ L# q% H+ a2 [: @   UF_PART_save();
1 _, Z- O) L4 q0 v) l9 P   UF_PART_close_all();7 [' g9 L6 N, d: Z9 q( ?
    /* Terminate the API environment */' M4 P  @7 w: Q$ n! B5 H; j
  UF_CALL(UF_terminate());& X% Z# k- I* n5 H' A1 T
}2 e, C) H7 Q# m* k2 B8 z
8 o8 U6 w  B' c; i3 W9 i+ P
  a$ m- l: }. T3 K; K$ k/ B
! g! x1 e/ Z$ e+ w% C" V9 e: }

评分

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

查看全部评分

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

使用道具 举报

全部回复1

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了