|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
* @% U/ l: D, f& i# A
7 \, U9 k) s- P1 R( Q8 ]
% f9 p6 L- @; X6 k' F, ^3 V, C: @4 t& I) x2 y4 Z s3 y
% R3 u. J7 f! L" r4 v& I
UG NX二次开发源码分享:获取边或者曲线的起点和终点(java)4 x* X- |+ S5 y3 I; c2 ?$ d
这里做个参考,你使用其他语言类似,对于一般的曲线,建议使用evalator进行解析!!% h8 Q# n% u$ Z1 |6 h
. z Y* H/ j1 A) [% g! i1 |
& F# s1 {. q( y
: ^" f: b& `/ F7 Q- ^) X. Y
3 B7 J4 i% ?) y- }8 f, kstatic Point3d[] askCurveEnds(Curve theCurve) throws RemoteException, NXException
3 a) t9 W) J" b1 @; G. e, [ {7 \! K5 H& d$ N* j+ J2 X
double[] limits = new double[2];
# b# ]$ L7 q8 D UFVariant evaluator;+ K( _. L9 T7 p4 x; |& W# ]
EvaluateData start;. h1 e0 U: g- m) e
EvaluateData end;
y; [5 R1 s# q7 e! ^
& E/ [3 q/ M r) a( L3 l; M5 [/ U b% _! h, F& V5 k
evaluator = theUFSession.eval().initialize(theCurve.tag());
( O3 K: P& T$ g/ `: {! D8 [ limits = theUFSession.eval().askLimits(evaluator);
/ X& g B8 {4 Y& |5 X0 @ start = theUFSession.eval().evaluate(evaluator, 0, limits[0]);; }4 w3 G2 K- v r0 L- [/ [
end = theUFSession.eval().evaluate(evaluator, 0, limits[1]);0 o% P- Q1 I- O* q
theUFSession.eval().free(evaluator);4 }) i. n/ @/ |; s) k" | S
7 `. N9 \+ E/ P
4 ~% ~# C# j0 ~- o4 g, [, Y9 X
return new Point3d[]
! g& C2 H$ n' w* W6 W: O) j { new Point3d(start.point[0], start.point[1], start.point[2]),! }: T3 O1 P* y! R) ]$ I4 F4 g
new Point3d(end.point[0], end.point[1], end.point[2]) };
. Q1 E3 Q: g7 E( f4 k) o) T% \8 O# G }
7 Y0 b+ t" I7 ~7 R
P) O0 ^0 i1 C0 S
0 X0 a V# {* ? P6 g1 h% Z |
|