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

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

[复制链接]

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

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

admin 楼主

2015-7-31 09:51:55

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

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

x
, D- L" M# Y9 ?' F6 W2 |. g

6 j; l' o& l# {3 O8 V
0 w1 \/ l6 o. t6 h0 x% L* K% e# R1 |) I8 {5 m
这功能其实很好用,比如选择面,自动显示面的法线等等。) i9 g, P/ D: b; |; @9 ^; d
0 H& }+ i" _( w6 }* d0 b) W% }+ Y, h+ S
static void do_UGopen_api(void)
2 t/ }6 v6 h3 t8 s. J{
: ^5 D% z) g  ?. ~2 a: x6 e  double pt1[3] = {0.0, 0.0, 0.0};6 X1 t# U" n$ Q: i6 Y+ e. I
  double pt2[3] = {2.0, 2.0, 2.0};! C  h! |, j# y
  double pt3[3] = {-2.0,-2.0,-2.0};" e# T& H1 V4 n1 S6 b
  double vect1[3] = {1.0, 1.0, 1.0};
/ p6 a" t, ]" g' D: ^7 O) b  UF_DISP_conehead_attrb_s attrb;
4 f" M, k1 `, k7 A  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
# V' e3 K& H7 `! S6 j& F                   pt1, vect1, 1);$ D  y) @. O+ A+ n
   /* Example to draw the vector with the base of its staff5 C5 Z4 ~  Q8 y/ R
      anchored at the origin so that the vector appears to point
: G1 e% t/ d6 e      away from the origin' n; s" Y# [, X$ }4 k
   */
) `+ t! b1 Z. r7 U2 r% r  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
3 X+ y# x" T! l. E                   pt2, vect1, 0);
1 J- [8 y- a! S" X, j6 ]' |  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
% b8 x, R5 P$ Y6 @                           pt3, vect1, 0, "Normal");
/ L7 q  C0 {5 ?+ j% C9 W5 a  UF_DISP_get_conehead_attrb(&attrb);- ?9 l0 {1 ~3 O8 w- ~- M8 F% v9 Z
  /* Use color index three */
0 G8 P8 B$ z! i6 `' m  attrb.color = 3;4 _) o# l5 ^: Z4 n5 l
  /* Update the current attribute settings */
7 U' L2 |+ q" P& D  UF_DISP_set_conehead_attrb(&attrb);
- k$ Q2 }- N- K# T  printf("\nCurrent conhead display settings:\n");
1 `# K1 O6 b, _& _( |8 X2 y7 R* i  printf("\tLength of Staff: %g\n", attrb.staff_length);
+ \) S/ A7 [/ o# e3 _2 p1 t  printf("\tTotal Length: %g\n", attrb.total_length);' D4 |9 z0 S" Z9 i
  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
7 l5 J. g" R0 l! H  printf("\TColor Index: %d\n", attrb.color);2 |" g% J# X4 x# k/ q8 B% P8 i& D
  printf("\tFont Index: %d\n", attrb.font);
0 i+ ]/ g) G2 d  printf("\tDensity Index: %d\n", attrb.density);
# Z9 G& Z7 i! S}
6 b! g% t# t% Y/ `" E) s/ v
3 K( b+ K% @4 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二次开发专题模块培训报名开始啦

    我知道了