|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- n5 q/ w) f* ~1 x) b2 O( N" jNX二次开发源码分享: Ufun设置工作部件重量, x" n- R- b1 y/ D8 U) B" `2 V L
' y/ ` B2 [1 z" d+ ~7 L( {* r' T
( z4 {( W0 d! l7 P" O0 S
[mw_shl_code=c,true]void do_it()0 ?1 N: F! {9 F+ \+ s8 Q3 x: q; S
{: J$ B% {) F( ]/ s$ J
tag_t workPart = UF_ASSEM_ask_work_part();. [" Q: X+ v% j6 U3 V( k
8 _2 r/ q# S. S- t& C" @- K/ E' P if (workPart != NULL_TAG)
+ f H2 L* i9 M5 M1 G3 @ {
4 P# w F; G+ ^- j UF_WEIGHT_properties_t propsOld, propsNew;
1 O4 q1 g Y1 j( {4 |+ u$ J8 b
3 n' U* w' ?2 O% `* Q# Q- K UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));
* ~ x A! B+ A U ECHO("Old Weight: %f\n", propsOld.mass);
- |7 k7 W0 v3 ?8 p; M2 u: e5 z1 |) M3 ` ECHO("Accuracy: %.2f\n", propsOld.accuracy);
$ d3 N8 x6 b- K$ A( h! y
4 ~2 ?2 Y* W1 Z# E# Z propsNew.cache_state = propsNew.mass_state = UF_WEIGHT_asserted;& C& p( v2 M* }) [8 F5 T3 `. f
propsNew.area_state = propsNew.cofm_state = propsNew.mofi_state = propsNew.density_state = propsNew.volume_state = UF_WEIGHT_unknown;
, [7 I1 U3 q! X" @- Z propsNew.accuracy = 1.0;( O& l! j: V6 I/ c) \
propsNew.units = UF_WEIGHT_units_gm;. k7 B% S6 O: n2 L5 |
propsNew.mass = 1234.56;
, l- N1 p! q1 S2 g/ n7 W# C UF_CALL(UF_WEIGHT_assert_part_props(workPart, &propsNew));
- W9 ?2 O c# c4 t8 C' T: \) A, f0 G) p
UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));
# ^0 j+ K4 {" o ECHO("New Weight: %f\n", propsOld.mass);
$ X: T6 D; R0 n) Q/ E }
& V ?* ]: l3 u8 u( |
" j% Q7 {, k, @}[/mw_shl_code]; c7 e) u! W% `' G/ M( h
|
|