|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
UG NX二次开发中常用的ufun API函数大集合,熟悉这些就够了
/ v' n4 l' }" l P5 Z7 g. { " c( Y9 w- \$ U) g+ r: r
这些函数是经常使用的,可以作为参考!
: i# S9 b! s% u' k/ J
; }# \2 s& I2 X1 w(1)和Part有关7 {6 N, C' b6 N% s# i, X8 v7 t0 q% F
UF_PART_open- C4 s3 S5 W) |7 |! E
UF_PART_close_all
) k6 R ]/ P: o& V UF_PART_save_all
& R* a6 Y6 l1 l UF_PART_ask_part_name
A8 z4 j; `. M1 M4 I' U6 R UF_PART_ask_part_tag* I7 H3 n8 s, n+ O/ k' ~
UF_PART_ask_units
/ w# w& P1 F8 t+ S UF_PART_ask_display_part
/ L5 u1 U5 Q, m0 l+ c UF_PART_set_display_part
: a: E3 c& Z+ L _) E UF_PART_is_modified
7 b9 f5 Q0 t7 ^ 5 S7 a* i9 L0 G- W- {) }
(2)和菜单有关8 g5 `8 }5 C7 n2 B* H) |
uc1601 — Display a Simple Message on the Cue line! @1 F6 r" ]# w0 r7 |' ~& H
UF_UI_set_status
. }9 ^8 z [- QUF_UI_set_prompt
8 `" d6 b' E: E5 d. y8 M) N+ U, Duc1603— Display Selection Menu
, Z" o0 i$ Q- J. W- ~! ]uc1605— Multiple Selection Menu
: s& M( P5 F* {4 W, s7 }3 q/ d' i(3)和选择显示有关
/ |: ]4 a" ]# w" l5 s$ G+ HUF_UI_set_select_mask/ n5 w2 c% Z$ I& }+ a
UF_UI_select_with_class_dialog9 D6 w f! o! E u; \7 d4 U! ?
UF_UI_select_with_single_dialog
. _# b# i3 ^6 dUF_UI_set_sel_mask7 c7 I; S, }$ s0 |
UF_DISP_set_highlight
0 ~$ w" f/ n/ G, RUF_DISP_set_display. b! d. r$ ^6 F. y* w
UF_DISP_add_item_to_display
9 m E6 H# w/ nUF_DISP_regenerate_display4 S+ Y; ~) ? Y% |+ ?( u
UF_DISP_refresh H3 ^4 ] {; x c1 x
(4)和装配有关
7 h2 w, f# @! x* n UF_ASSEM_create_component_part) r5 U: n& D6 Q% e8 B0 H- c
UF_ASSEM_create_mc_array& e' e s; Y7 a8 v) D0 _
UF_ASSEM_ask_work_part
( I2 c2 ~" F# q2 t$ K7 K; u UF_ASSEM_ask_component_data, P1 k5 F" f, U7 L( _
UF_ASSEM_ask_mc_array_data
w4 @, N7 O% ~$ S1 v UF_ASSEM_ask_assem_options5 Z& K: S* F2 h; P! ]: o- C# g8 s
UF_ASSEM_is_occurrence
- F J- H3 N3 f4 U8 O2 M, n1 v' D$ a UF_ASSEM_is_part_occurrence
! n% w, q3 C5 F O2 { UF_ASSEM_ask_prototype_of_occ$ c0 {( Q+ s1 H3 y2 P$ r# J7 ~
UF_ASSEM_ask_inst_of_part_occ; Z2 q" |6 {' F7 N- Q; T
UF_ASSEM_ask_parent_of_instance
6 e4 l( q4 y7 v( x1 n5 ^6 }. E UF_ASSEM_ask_child_of_instance% l% C5 L( ~$ F
UF_ASSEM_remove_instance) {# R0 K4 Y) ?# y
UF_ASSEM_ask_occs_of_entity, O; W( a C1 S# ~5 ~! @
UF_ASSEM_ask_occs_of_part! k9 a' y7 E' e! \
UF_ASSEM_set_assem_options5 D/ `) }* {/ T- k$ N" L- O& K, P" e
UF_ASSEM_cycle_ents_in_part_occ
( C1 V7 G, ], \' [# V! U7 J0 o+ @(5)和图层有关
5 P( \& M1 |4 g! I UF_LAYER_set_status6 {9 c! x, X* v" ?
UF_LAYER_ask_status+ [( z) `, V' R3 K- Q/ J- L0 v
UF_LAYER_cycle_by_layer
0 z- [$ R6 Q4 O; g+ S (6)和对象相关
6 q" o d4 m, X3 a2 { UF_OBJ_delete_object
2 x+ d$ b% i! O' s4 _$ f UF_OBJ_ask_status8 _% s! l/ | H3 {
UF_OBJ_set_def_cre_color; M2 {; X- v3 O: N
UF_OBJ_set_cre_color
0 E0 S- x% G% \9 \ s UF_OBJ_ask_type_and_subtype
3 v1 T7 R/ o$ E" X. u' n M0 f (7)和表达式相关$ D V1 G9 J9 {, ?% u3 t$ l- ]! F+ _
UF_MODL_create_exp8 J6 @1 o; E8 V5 ^
UF_MODL_ask_exp6 z T/ T! F6 [
UF_MODL_edit_exp
6 f1 p- z K: W. `2 x& @# | UF_MODL_delete_exp
! _9 }2 b' f; ~! l: J8 |8 Z UF_MODL_eval_exp
. c7 x* e. u, k9 ~4 o0 g! P6 z; f9 E UF_MODL_export_exp
; D G6 i9 B$ i* T! t# }! R2 c4 \ UF_MODL_import_exp( M/ g5 I5 a6 Y9 G
UF_MODL_rename_exp
. q8 X* A6 x6 p6 t7 r% Y UF_MODL_create_exp_tag' ?5 v* V6 ]/ B1 o+ S6 X
UF_MODL_ask_exp_tag_value
8 i( A9 S3 [# L# K, w) F UF_MODL_delete_exp_tag4 E. p( c% U6 d( s
UF_MODL_ask_exp_tag_string" i# |% U: Q, H( ?" f# ]$ y
UF_MODL_dissect_exp_string
& P! D8 g3 }" O: D& O UF_MODL_update
0 i3 N' L* h8 U; S* F) X# t3 S& E (8)和模型链表相关
! H6 {2 f9 ^6 R. n UF_MODL_create_list
. }1 {: \' @! @4 p1 ]* D) {2 G UF_MODL_put_list_item
/ U- P; J& B9 S. l* [) u UF_MODL_ask_list_count% x" h3 C% h# Y Q8 X: F, v! Z
UF_MODL_ask_list_item* a s( S# \+ z4 i
UF_MODL_ask_list_item+ v& a+ o4 s+ ^
UF_MODL_delete_list
; ]# t+ @5 M8 X% C0 n( z2 w) D UF_MODL_delete_list_item1 C @: W" X2 u" W' J/ }
(9)和创建模型相关
B: p% C: F2 B8 l1 ^" _2 j1 |UF_MODL_create_block1' S+ }9 H i, W" X. L, }( \
UF_MODL_create_blend
$ u. T+ E {4 g( d2 k9 I- m$ g UF_MODL_create_cyl19 H& _! c& \' L) l/ V
UF_MODL_create_hollow; Z! S# ~1 ] O
UF_MODL_create_linear_iset! |% |( ?7 ~6 _
UF_MODL_create_rect_pocket. h% i7 K- s- k/ T0 n
UF_MODL_create_rect_slot
( |4 z: i: A$ }( d% E3 G UF_MODL_create_simple_hole
$ [. Y) |- W& S+ N! V6 ^ UF_MODL_operations% k5 e1 i' ~4 K% X" i7 o
UF_MODL_active_part
# ~" n( ?# r! e(10)和模型查询相关5 E7 b7 ^3 l) O4 W# P1 \/ w; T
UF_MODL_ask_feat_body/ L0 w3 {2 ~& P* \1 X# z/ }
UF_MODL_ask_body_type6 o8 s, p; |( Q+ Y+ R
UF_MODL_ask_body_faces
+ T5 W2 ~, |' V UF_MODL_ask_body_edges' R4 a9 K' z# W$ I
UF_MODL_ask_edge_body
: y% d* i' d) i; p" _& _' b: Y! F UF_MODL_ask_edge_faces" L9 y- O x) H+ A' A+ m' y
UF_MODL_ask_edge_type
0 j* ~( r: N: ?% x7 K. c: j UF_MODL_ask_edge_verts- {6 s3 S; m$ E; ?8 K
UF_MODL_ask_face_body+ Y7 ^5 m* p" z) r+ i5 @
UF_MODL_ask_face_edges
" e$ V# O* T) K5 g/ h UF_MODL_ask_face_data
" x$ v7 _& L/ E0 t UF_MODL_ask_feat_faces$ Y' t3 U5 I# m) z
UF_MODL_ask_block_parms
7 y" W; w3 _' L8 G) o) |$ ^ UF_MODL_ask_minimum_dist# v" Q0 S/ s) ?
UF_MODL_ask_simple_hole_parms
O, r& _+ @& `2 F(11)和对象名称相关
' z# [1 v7 E4 S! ? UF_OBJ_set_name+ p. r# o4 L* \. F! S
UF_OBJ_ask_name& K! o; Q J: x3 K
UF_OBJ_delete_name
$ e& _0 s. M& ?: Z& o% a UF_OBJ_cycle_by_name
' i0 e% M, G% B* D; a4 u7 ](12)和制图尺寸相关
4 d- |7 }# m, h n; _ UF_DRF_ask_preferences7 s6 E/ m/ A5 l4 ]! A: o
UF_DRF_set_preferences
; B' P" |( Y. `; t5 S$ D$ b: ] UF_DRF_create_horizontal_dim
7 M' X5 S. L- Q6 } UF_DRF_init_object_structure
( H9 \( V: W/ E N7 I& k3 b3 d' _ UF_DRF_create_vertical_dim
7 e6 B0 z. S+ X! d e UF_DRF_create_note
$ n3 B$ f5 o0 t) r UF_DRF_create_label
: ?% y& B, u7 a0 X- h UF_VIEW_ask_tag_of_view_name) w5 W, [. y/ T3 L2 ?) L! c8 i
UF_VIEW_expand_view7 n) ?7 y7 R. l4 j
UF_VIEW_is_expanded
7 G8 N' f) f, ~2 B4 V. z# _4 Q UF_VIEW_unexpand_work_view7 ~, a ?, Q5 P: O8 h* e3 n
(13)和视图相关
5 J% D) L. F! ^ uc6476 //Set Drawing State
! B5 A( W- _" ~+ j uc6477 //Retrieve Drawing State& l1 P4 h+ f8 o) v4 M- ^4 K
uc6478 //Create Drawing
/ O$ h% h, A. Y: n! F, B uc6479 //Read Drawing Size
; \6 D* }+ i7 c4 r1 n$ O; F uc6480 //Set Drawing Size
) g) k' i' A' j+ v, Q$ c, x' e UF_DRAW_ask_drawing_info
" i9 R: T7 ~! ~ w% j- e UF_DRAW_set_drawing_info, K( O1 r7 [2 y( h# F# k
UF_DRAW_import_view- j5 P) Y* R7 t/ L U+ p
uc6481 //Add View to Drawing
- v. ~+ E' X, v3 i! K) _2 d! G uc6482 //Remove View from Drawing8 v- d3 p# H% x- R1 l2 t+ j
uc6483 //Read View Reference Point on Drawing
: K0 {1 V; B3 ]& O uc6484 //Set View Reference Point on Drawing" v" G, R( i: m; @5 c; A" j" H# H
uc6485 //Read View Borders on Current Drawing |& ?4 ~' A1 m
uc6486 //Set View Borders on Current Drawing; P9 D( b) t0 z1 t
UF_DRAW_define_view_manual_rec t
9 P7 g6 I2 t1 y& q4 D2 F* b$ x UF_DRAW_update_one_view( `) ^' C" }4 F1 q. X' T+ f: u2 b: q/ p
uc6492 //Read Current Drawing Name
3 w2 [' v I) D$ W: z UF_DRAW_ask_current_drawing+ P ]8 o/ f6 @5 Q T
uc6496 //Rename Drawing
5 i* e0 ?/ H* L: y L; B: P4 [ uc6495 //Delete Drawing; D. z g; C" c R* H. X
uc6499 //Cycle Views in Drawing% N5 S7 k) U2 ^" {* t
(14)和属性相关6 H1 `. s# i' ~% ?: m! f- T% m
UF_ATTR_ask_part_attribute
7 G7 _7 @- a1 ? UF_ATTR_assign4 j* V0 l$ k5 l: O w5 ^( y! ~* M; G
UF_ATTR_ask_part_attrs- e( H9 r: H. S' P2 D4 l
UF_ATTR_ask_part_attrs_in_fi le+ B) G) F8 V! r6 `* e
UF_ATTR_read_value) R: R, B, t8 f
UF_ATTR_cycle9 @/ a. q; b0 N) f: C2 v8 s& w
UF_ATTR_delete& q; r8 J8 k) k* m) s* j
UF_ATTR_delete_all7 r5 f+ |& f- B; G% }7 i
8 H. \ V: e5 |/ i/ k' W" p; ?
7 J- u3 m- O7 e F, e# U% h$ G! ^ |
|