查看: 3486|回复: 0

[二次开发源码] UGNX二次开发源码分享:关于显示UG NX临时箭头功能

[复制链接]

4

主题

3

回帖

38

积分

管理员

积分
38
发表于 2015-7-31 09:51:55 | 显示全部楼层 |阅读模式

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

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

×
( P* @3 f: C" L% O3 }$ _& w5 D' M. ?
6 n' M" o" \& X6 a% E" |
  f4 \; d+ B) |) d
- l; v5 D1 A9 [$ ^: B. J1 b
这功能其实很好用,比如选择面,自动显示面的法线等等。
4 \4 ~/ ]3 m. `' I- {! e; G' a; r% x3 m- ~- l/ T7 i$ `
static void do_UGopen_api(void)
" L* R+ `# l3 f1 r7 ]{
( _* N5 l: V4 }( p  double pt1[3] = {0.0, 0.0, 0.0};8 w+ e/ n8 F) c$ ]6 Q( _
  double pt2[3] = {2.0, 2.0, 2.0};9 `+ l. \" N' W, Q# @3 l
  double pt3[3] = {-2.0,-2.0,-2.0};. \+ U. r/ I: l6 c
  double vect1[3] = {1.0, 1.0, 1.0};2 C- [/ d" T* U4 f, Z+ l9 u. i4 d
  UF_DISP_conehead_attrb_s attrb;* ]; D, `4 k. E1 s! j5 [
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,7 Q2 J$ y/ H0 `& N
                   pt1, vect1, 1);
6 i$ F1 \: q8 ?9 k- n( ^   /* Example to draw the vector with the base of its staff" ]* h% Q8 d0 f' M! ^
      anchored at the origin so that the vector appears to point
! U$ w8 e! f1 S" [" B; `1 {1 K      away from the origin. w0 i. I$ X( \$ c" G" E
   */* ^" c3 }. R! U) S
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,( d7 D$ x8 I0 N/ P/ M2 Y3 P
                   pt2, vect1, 0);) K) X/ h0 }! e  M
  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
  r1 N5 }; K" ^+ h* T6 s1 \! n. X                           pt3, vect1, 0, "Normal");6 @  l$ e) R/ D
  UF_DISP_get_conehead_attrb(&attrb);! Z8 @% G( T6 |3 J) L
  /* Use color index three */
  h1 u$ {. ~; b" ?  attrb.color = 3;
6 R9 I- Y1 [! ^8 o4 ^  /* Update the current attribute settings */+ E8 g9 \! I1 T
  UF_DISP_set_conehead_attrb(&attrb);+ e* z0 L2 s5 J5 U: G, e
  printf("\nCurrent conhead display settings:\n");
+ W' i3 P" m9 Y  _( Q5 S  printf("\tLength of Staff: %g\n", attrb.staff_length);
! h1 q1 E. z: ]0 z  printf("\tTotal Length: %g\n", attrb.total_length);/ w; E3 I: N+ z2 P
  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);/ `: M  ]8 J# }" P# P/ S
  printf("\TColor Index: %d\n", attrb.color);
" d5 |2 o# ]3 }7 Z% z  printf("\tFont Index: %d\n", attrb.font);
# V* m; G: o- o  printf("\tDensity Index: %d\n", attrb.density);
! F) ?! ?7 Y$ j: @7 J  s}
' ^+ K) G, E$ `$ f9 C5 R
3 W0 x7 T/ Q/ A1 E6 Y( u
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

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

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部