|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. y% r; t5 h$ k& hNX二次开发源码分享: Ufun设置工作部件重量2 `& \7 `4 G! ?" B _2 ~
3 C2 j% l- K4 l; v7 Y
2 U. E- L9 G. b" e; {) k- J[mw_shl_code=c,true]void do_it()% U3 u" {0 C1 w3 D2 Q- g# l
{
# s$ T! s) @0 W6 M- Q& P" O! u tag_t workPart = UF_ASSEM_ask_work_part(); e5 ?' [ O, _
* q% U9 v! M9 X: G" Z0 B& E' M if (workPart != NULL_TAG)
- G% t2 {/ _( O5 d$ O! q5 ^0 } {
' j, i3 w* y1 z1 c% A; e' @ UF_WEIGHT_properties_t propsOld, propsNew;
6 s+ s' S4 Z; M( r8 I6 q/ B( F* S+ ~/ v7 [- r& C
UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));
z/ h6 J6 i8 O8 F9 w: j' J ECHO("Old Weight: %f\n", propsOld.mass);* d) U" J8 x( O8 Q8 A# ~
ECHO("Accuracy: %.2f\n", propsOld.accuracy);0 P; I8 Y0 N' b; }3 W
/ k+ }" e7 r, y7 m propsNew.cache_state = propsNew.mass_state = UF_WEIGHT_asserted;
0 ]+ S- I# @. {. |2 z% F; y propsNew.area_state = propsNew.cofm_state = propsNew.mofi_state = propsNew.density_state = propsNew.volume_state = UF_WEIGHT_unknown;
" i9 w: X, F8 a: i propsNew.accuracy = 1.0;
+ Q$ [0 A- M0 T: _8 N! @ propsNew.units = UF_WEIGHT_units_gm;
+ @/ S1 @- `: [: R( c1 ] propsNew.mass = 1234.56;, i4 V, z; R7 j' ~
UF_CALL(UF_WEIGHT_assert_part_props(workPart, &propsNew));
: u3 A$ _: p: z. V5 d+ T4 T
. P7 Q: H" o2 `( _ UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));
' g$ e, B9 B& D' i/ A; U* _8 A ECHO("New Weight: %f\n", propsOld.mass);! m- S2 ]# u; ~% Y! c5 d
}' _* Q* y& `3 k7 `
6 ~, }, |) X$ z( |$ q# D3 f
}[/mw_shl_code]* U# w0 X* [( ^1 F2 K" l4 m
|
|