|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
) F, L( {! D( ^; P
% ?1 b% E$ r! m/ w, {- h
UG NX二次开发源码分享:使用java来显示曲线或者边的方向
9 u+ ]4 q; H' w* E& l& Z# z
% g9 _: ^9 C7 ?7 y6 L, b如果你用C的ufun的话,应该很简单,java这么用,基本都一样!!!
7 {: F- v2 j2 g" S# g' R" e
4 Z" w0 m( p5 U3 q5 _& O, O; a# F3 q static void showCurveDirection(NXObject theCurveOrEdge) # l; b ]0 J# j1 I+ I0 _* _: P7 _
throws RemoteException, NXException3 r; `+ Z. s. |" J# d
{
8 M# {3 s! W4 o+ J( K: h) t double[] limits = new double[2];
" ?# i$ \& G0 ^( }$ u5 G UFVariant evaluator;7 m1 {5 Y; P( _$ P7 n
EvaluateData start;
( }+ e1 F! n% D$ F9 u
( i. n: H6 ~/ D0 I+ E evaluator = theUFSession.eval().initialize(theCurveOrEdge.tag());% V4 ]$ v. l8 W) y5 f$ _8 S" H' K
limits = theUFSession.eval().askLimits(evaluator);* N, Q/ B4 p( Y/ l! D8 q/ a4 p( P
start = theUFSession.eval().evaluate(evaluator, 1, limits[0]);3 U; ~8 g* z5 s1 u) D
theUFSession.eval().free(evaluator);8 Q& h' c$ w9 Z
! T3 Y+ [( \6 |0 n
Point3d startPoint = new Point3d(start.point[0], start.point[1], start.point[2]);
2 f( m$ x" `: u' ^- B Vector3d dir = new Vector3d(start.derivatives[0], start.derivatives[1],
3 r) [3 Y8 _9 o( \9 S start.derivatives[2]);, ]7 s- }) d! ^5 L: J
displayConehead(startPoint, dir, "Curve Direction");
4 ~9 x9 z4 c, z# C2 Z5 j4 b( X# V! A, ]1 ^/ x* S' x" V
}& g' e, p5 i- S+ `; g7 J. z
( S) P( j. |) r$ ]( C: z
|
|