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

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

[复制链接]

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

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

admin 楼主

2015-7-31 09:51:55

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

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

x

+ z  S- Y# I! n* d' \8 ~4 P1 w5 ]0 f! L  T& a5 l

5 y7 k9 g! g/ ~/ L# ^- N* O: f0 s# |! N8 o
这功能其实很好用,比如选择面,自动显示面的法线等等。
  X9 g7 l, R1 V
, H# u# {$ x, d& S, d# zstatic void do_UGopen_api(void)4 w# K" f* X  ?  P7 t" O+ S
{0 o3 b; A) \, q8 U& L* H0 L
  double pt1[3] = {0.0, 0.0, 0.0};* z- f8 u0 p: s1 U$ n; k0 d
  double pt2[3] = {2.0, 2.0, 2.0};+ }9 j/ a# Q, V) I' H
  double pt3[3] = {-2.0,-2.0,-2.0};
9 t$ a0 l* Z# t* P8 d; V- a  double vect1[3] = {1.0, 1.0, 1.0};
/ U% z3 M9 R! @+ r. @; J  UF_DISP_conehead_attrb_s attrb;4 ~& t+ |; ^9 f6 \( l- f) ^1 Q+ ~" q
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# y4 o* k" e' X' ?! Q& a
                   pt1, vect1, 1);
, P; X! n" }6 h1 y; m* I   /* Example to draw the vector with the base of its staff
  s4 j1 u, a& e: ~3 ]      anchored at the origin so that the vector appears to point
7 ~0 v: w- {! C" ^6 J, E7 d2 ^      away from the origin" @' `- t6 ~) {: ^9 t# |1 l9 ^
   */
6 w# M$ ~+ B( N# g  D  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,2 ]3 ]1 _0 A( I/ a' A& {
                   pt2, vect1, 0);
* h& c  d, e6 o' c1 r  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,. {1 ~2 o- x% ^: A6 R$ |; v! C2 H
                           pt3, vect1, 0, "Normal");
! c% i- ]6 ], b  @0 M  UF_DISP_get_conehead_attrb(&attrb);
& G" h6 e0 J( k3 G7 {" Y7 K* S% i  /* Use color index three */- g6 y/ {# P4 e! E7 U- Y; ^4 h
  attrb.color = 3;
, E, H+ _2 V: ~1 q9 U- w  /* Update the current attribute settings */, h& t0 o. ]8 i( }" F3 i  {
  UF_DISP_set_conehead_attrb(&attrb);, x9 S$ D, d0 E5 d: z
  printf("\nCurrent conhead display settings:\n");
) }" u$ K3 O3 s0 l2 N  printf("\tLength of Staff: %g\n", attrb.staff_length);; a  _: \; m* s3 F5 Y" S$ z
  printf("\tTotal Length: %g\n", attrb.total_length);
/ g- B2 O& P, G7 c. G& k4 r3 ?  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);) c. ~% j9 }6 }; l4 O% `
  printf("\TColor Index: %d\n", attrb.color);
% q  H. M+ z* Q) y' I' _  printf("\tFont Index: %d\n", attrb.font);
# ^! m8 d: O$ [- o  printf("\tDensity Index: %d\n", attrb.density);4 J$ v0 e8 }+ R& Y1 A
}
7 Q4 c5 ^$ A+ I5 {/ F5 C+ o6 a- ~: H: P5 ?) b, j% x: F
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了