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

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

[复制链接]

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

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

admin 楼主

2015-7-31 09:51:55

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

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

x
- }& Z: V4 ~' a' D& n1 g
: Z9 `/ t& [0 c& g0 l' `

; R: r# [4 z4 e( S8 [0 W) u  [, _5 Y
这功能其实很好用,比如选择面,自动显示面的法线等等。% I6 K5 `2 T; h

* H! {% s9 D+ |# H; Z' O  Ostatic void do_UGopen_api(void)! v! o0 m! f# I+ ^" @; _3 i
{1 G2 x  D& R% r* v% m
  double pt1[3] = {0.0, 0.0, 0.0};
. ~7 [+ |4 ]% E) e* P3 |1 ~& ~  double pt2[3] = {2.0, 2.0, 2.0};  t$ v6 B/ f& ?) G& x+ d& f& ]
  double pt3[3] = {-2.0,-2.0,-2.0};
/ r( q+ P+ i' b1 _, \  double vect1[3] = {1.0, 1.0, 1.0};8 P) t9 K9 m2 _. D9 B+ B: Z1 |# {
  UF_DISP_conehead_attrb_s attrb;
) z% |1 `( h3 n; V) l  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
$ [/ o3 V% A  a. d9 ?! b% j                   pt1, vect1, 1);9 J+ g6 Q2 R- ]9 R
   /* Example to draw the vector with the base of its staff, ~) t+ g1 Q* k+ o: C: z
      anchored at the origin so that the vector appears to point
  Q; ^) x8 c2 O      away from the origin+ E  o+ v( [  T1 O2 M2 s5 J3 Y
   */& E& P5 v* z5 J8 X6 x+ m) ?
  UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,. U1 w6 V5 j; Y- x
                   pt2, vect1, 0);. g8 M4 {, N, h: U7 _/ }7 a
  UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,; h' i: A# [" p) |( g. }+ F5 d
                           pt3, vect1, 0, "Normal");
# g& z* G  G0 Z9 x8 f  UF_DISP_get_conehead_attrb(&attrb);
! W0 P) }4 o1 H/ m) E2 a; p  /* Use color index three */9 D( g4 Y! @% N8 {  |/ Y3 R4 {
  attrb.color = 3;; @- Q* Q# L# s% h  W3 V
  /* Update the current attribute settings */
9 {" c" s" B( `( O/ _% ^& }  UF_DISP_set_conehead_attrb(&attrb);. R3 X/ g6 x0 K+ y; m4 E
  printf("\nCurrent conhead display settings:\n");$ P# x. `! B! e! ?+ w
  printf("\tLength of Staff: %g\n", attrb.staff_length);+ w( V# O* G! l6 Z  [' k
  printf("\tTotal Length: %g\n", attrb.total_length);
$ {4 @2 i: C) a9 k$ `  printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);$ z- K& }' V( Q+ ^1 S
  printf("\TColor Index: %d\n", attrb.color);
4 I) R  {0 d& k# J- a& z1 G  printf("\tFont Index: %d\n", attrb.font);
+ D! J" n/ m7 }, i& z6 P  printf("\tDensity Index: %d\n", attrb.density);
/ ~. b) h! \8 x4 ~}* m5 a) ~% z  f2 I; |1 k+ D8 z
$ ^! u9 L* [' @6 K1 M
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了