PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2015-7-31 09:51:55

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

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

x

. D9 l8 L* |' d& \
! n3 H1 X7 \# _2 a" x0 B- i$ E' \4 M3 H) @  F
* i. d& U0 f6 `( M% l- P
这功能其实很好用,比如选择面,自动显示面的法线等等。; C5 f, B: N- s0 U8 A
! v  w' I/ g* i) o; u/ E
static void do_UGopen_api(void)
# w, u8 w- c# W{
' c9 X! J' k0 W  double pt1[3] = {0.0, 0.0, 0.0};- F2 _# L6 z# T- g
  double pt2[3] = {2.0, 2.0, 2.0};
" P! S! B- c! s) C6 ^8 z9 c- K  double pt3[3] = {-2.0,-2.0,-2.0};. k5 b( _2 X. B) S; ^7 P
  double vect1[3] = {1.0, 1.0, 1.0};
( P4 E: A2 ]. ~% H( F: ?4 ?+ ^  UF_DISP_conehead_attrb_s attrb;4 Z. f7 P9 |" S. L- z' F
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,  }' t4 s5 d4 a7 |( W: N- P
                   pt1, vect1, 1);" l8 B1 q1 f9 Y4 u- A1 ^
   /* Example to draw the vector with the base of its staff
/ ^$ u  y6 ], f7 n" @- @3 v      anchored at the origin so that the vector appears to point
7 i6 V; j/ r9 g8 g& ~. h6 g      away from the origin6 G* S, b" I0 J( ^5 |% \, T( F2 i
   */3 z$ V/ r& a6 V! N; r
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
  ]- E5 E0 X- u0 a% y- w/ P8 n( g4 u                   pt2, vect1, 0);# g  \* |! p) y
  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
( g  r- W. k7 P: Z+ R7 Q, u9 L: w                           pt3, vect1, 0, "Normal");
7 J" U( Y' O# O2 u9 t  UF_DISP_get_conehead_attrb(&attrb);, X' G: z# Y+ N5 T0 ^1 e
  /* Use color index three */
" D* t" q  G+ @( T  attrb.color = 3;- G' [. J9 e8 V3 ~
  /* Update the current attribute settings */- u/ l5 T' \% E2 ^% l) N: [1 n$ ]
  UF_DISP_set_conehead_attrb(&attrb);/ U; a9 ~* `, K" M/ @
  printf("\nCurrent conhead display settings:\n");3 r1 y6 _* D0 F8 V/ G
  printf("\tLength of Staff: %g\n", attrb.staff_length);
% Q- |' s  n& x  O* O  printf("\tTotal Length: %g\n", attrb.total_length);" g! i1 |7 ~( l3 v0 w
  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
7 N7 ?% ?" d9 W0 r$ ?  x  printf("\TColor Index: %d\n", attrb.color);' v" l+ Y# n# D
  printf("\tFont Index: %d\n", attrb.font);
; Z' T, u, ?+ v9 t4 D  }* H  printf("\tDensity Index: %d\n", attrb.density);. A- [& O9 p+ w8 w7 i3 }7 z( @
}
; ~2 p. d9 m/ {) ^+ s3 h( L* y: t8 z) {& `! S
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了