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

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

[复制链接]

2015-7-31 09:51:55 3389 0

admin 发表于 2015-7-31 09:51:55 |阅读模式

admin 楼主

2015-7-31 09:51:55

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

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

x
& n% Y; E0 V  o( N! w2 C/ Y& D
1 S  Y$ \3 n: u  ~# y
6 @) I: O' _# ^$ L6 \
4 M( m$ ?5 {8 Y: r
这功能其实很好用,比如选择面,自动显示面的法线等等。  R7 Z+ L# X9 I3 I7 ~
+ k9 L6 f; b3 G6 `+ W( j
static void do_UGopen_api(void)6 s( h7 |  g+ K+ e. s* [( ?
{0 s# S- i- V9 z1 [9 d
  double pt1[3] = {0.0, 0.0, 0.0};
: l7 V' `3 |1 g2 x  double pt2[3] = {2.0, 2.0, 2.0};# N8 t& H/ l1 ?# P( p  u4 r' f5 l
  double pt3[3] = {-2.0,-2.0,-2.0};! s5 k8 O( Z1 Z
  double vect1[3] = {1.0, 1.0, 1.0};* g/ M0 w2 y. V5 m
  UF_DISP_conehead_attrb_s attrb;+ a: g5 ~6 T. F6 n7 N' b- v# f
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
/ \9 k) j3 b; @0 d' k                   pt1, vect1, 1);
- o6 Z* w- z9 y   /* Example to draw the vector with the base of its staff' v# E' \( a) b- L2 U
      anchored at the origin so that the vector appears to point% f* m9 }8 T& k4 R" W% g
      away from the origin( I! t. g# j% c4 K+ c9 R0 x
   */
# V& v# w3 }5 C4 S  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
) ^" Y6 k3 s, N3 `7 A% D) k2 t                   pt2, vect1, 0);
- g2 o" Y- I2 W" D  s: g% I  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
7 R' P' p& ^' n) x5 {& P                           pt3, vect1, 0, "Normal");) L) W' @5 q; F' m
  UF_DISP_get_conehead_attrb(&attrb);
& T3 `2 m# s& S# ?% Q  /* Use color index three */6 w- d9 @/ _  r' N' w
  attrb.color = 3;# f8 L5 W4 E; f5 T6 L% P% e) ~
  /* Update the current attribute settings */
, m9 ]/ i) U4 c8 H$ f" `  UF_DISP_set_conehead_attrb(&attrb);: _4 J) E7 j, W6 P
  printf("\nCurrent conhead display settings:\n");/ l: c( V6 |, O, q8 N
  printf("\tLength of Staff: %g\n", attrb.staff_length);
' \' {7 z# m2 i  printf("\tTotal Length: %g\n", attrb.total_length);" \' z( I; O8 _' O! G, Q
  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);9 H0 g/ {" O1 U+ r+ C9 {8 C
  printf("\TColor Index: %d\n", attrb.color);
; c4 u: j$ @0 r" t  N  printf("\tFont Index: %d\n", attrb.font);) J$ z, J  _$ l( J9 Q
  printf("\tDensity Index: %d\n", attrb.density);( ?4 M& |0 k, i" v# K
}2 ?4 A' K! }# b2 B% k
* M! j: [/ N/ r/ C. }0 L
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了