|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
B% _( m. O* |, b& w% s
UG NX二次开发源码分享: 获取曲线端点
& g2 h* ^, k9 N6 ~/ l( w7 u! b! D6 K1 O; H% a& b
static Point3d[] askCurveEnds(Curve theCurve)' [# F% s5 x$ H2 z! e6 a
{
3 \ g$ p) i9 k p double[] limits = new double[2];- i8 v8 ~4 _& Z4 `2 h5 B
IntPtr evaluator;
" ?- o8 ~! [) T double[] start = new double[3];
6 C- [$ X) J4 s1 s. w T/ N6 ~ double[] end = new double[3];
, O1 M x! \! q) b& H
/ F* e# z7 [1 W0 F theUFSession.Eval.Initialize2(theCurve.Tag, out evaluator);
' t/ D4 I H+ l: `* u1 R theUFSession.Eval.AskLimits(evaluator, limits);
- c$ M. F+ M h1 e theUFSession.Eval.Evaluate(evaluator, 0, limits[0], start, new double[] { });5 M! R% k1 C" g5 n- V% [& v9 u
theUFSession.Eval.Evaluate(evaluator, 0, limits[1], end, new double[] { });% g& |: Y! D$ ]2 K5 i: }
theUFSession.Eval.Free(evaluator);
; B6 e* J" N$ |5 a
) A Y+ H3 B# L4 `& [6 O( J* J return new Point3d[]5 e) S- B- h! ~4 g+ r W# q
{ new Point3d(start[0], start[1], start[2]),) q. K* a; p+ s- i
new Point3d(end[0], end[1], end[2]) };) `" f. ]" K9 }4 V
}
/ c. K! J2 F U6 U* Z6 `
" z- M0 P9 Z b5 B- X8 [* c1 d |
|