|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
代码分享下,其实场景是这样的,我们要需要抽取一个边的线条,通过composite curve去处理,但是在非装配下,基本上是通过composite curve进行抽取,在装配下,需要通过 wave link composite curve,两个方法场景不同,这就需要进行分别判断。) P3 O U( w4 j5 {: r7 R" b
) \, { }" v' R9 b3 F, i3 X4 \
紧紧判断是不是一个occurence还不够,因为在选择边如果零件是工作部件的话,这种情况wave link是无法使用。
9 O% {( p) [2 ~2 L% W9 I: T4 ~" b6 l5 |' ]+ F* i" K
if (!selectFaceGroup1.empty()&& !selectFaceGroup2.empty()&& !selecTCurveGroup.empty())1 O. \% U% P) U( P E
{
2 R2 e' p/ |# Y. {1 |9 X$ b. \ // we need add more check for the edge selection2 e3 t: A& s# r- m: w1 q S5 R9 {
for (int i = 0; i < selectCurveGroup.size();i++)
0 H# X- q$ Q% N' D* ]- u3 t7 c: h {
4 }5 n1 _6 \; H6 r6 X //////////////////////////////////////////////////////////////
9 b! k( R$ S0 b# X& O# v" C) @ Edge * selectEdge = dynamic_cast<Edge*>(selectCurveGroup.at(i));
# I; u' D: C6 x0 J: A; P" g if (selectEdge->IsOccurrence() == false)
% Y' r0 {* c$ C: X/ d {
8 o7 p# o5 `7 ^- N+ i/ I selectedEdges.push_back(selectEdge);% J! J3 `; ^- I; I9 V4 W" v' `$ E$ y
}. }5 r. t8 k0 {7 D! f: k
else
0 q9 w# }, ^& c! q {0 V7 [( H4 ^! T5 w3 q
if (selectEdge->Prototype()->OwningPart() == workPart)) H: o7 R9 y4 G' v6 L! B
{
3 n; G: D, `- D% A, V& b selectedEdges.push_back(selectEdge);
- D0 k. Z: u* I, }% l: H }
. b3 L8 @9 c8 V else4 F: m3 m1 e$ U( x6 I% J
{
" A7 ?& H: o3 W9 J4 d) i% C selectedEdgesOcc.push_back(selectEdge);. y0 Y) T/ S" I" C/ o
}, O$ u; m1 i) k. z) S
}8 p% d7 \2 j+ ~1 t
}
0 \0 N* C' X& f1 v; k4 V w% R2 P0 {6 ?" t
2 l, d' w) P" ?7 \4 [1 y, |0 u
//2 get composite curves
; M; Z, b% g, [7 z if(!selectedEdgesOcc.empty()); A- K( P% |) f( G; [+ t
{' X. k4 U8 v+ }: c) k O, U
errorCode =createWaveEdges(selectedEdgesOcc,compositeWaveCurves);
/ o$ @2 C" b) i% ~( I4 N5 S6 p if (errorCode || compositeWaveCurves == NULL)& V5 m4 @1 C. G, V! A
{9 u- z& ]0 y' F+ X: E1 q
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Wave Composite Curves failed!");1 E7 D, s/ L* l2 l. G- h
return 1;
0 K: Z* \ s0 V4 L% H8 t }
( z5 }5 H3 A% y9 i, ?0 B8 O vector<NXObject *> allCurves = compositeWaveCurves->GetEntities();" B3 U7 j8 c0 P# b( e" v
' K: [; ?. F2 Z5 Q% A# J! y for (int i = 0; i < allCurves.size();i++)% E: p8 n* h" M9 a! r B8 P
{% P, ~+ z5 O% k% x5 C7 E
sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));/ { O$ c& _% y
}+ w# u5 C! C. d
}
/ T9 N0 ^ h) ` if (!selectedEdges.empty()), n5 P! P8 z; V( l: x$ C1 n
{
( T8 s0 P: ]; A% S# Z errorCode =createCurvesFromEdges(selectedEdges,compositeCurves);
' d8 h+ E, L. y9 z% j- X. U. I if (errorCode || compositeCurves == NULL)% s7 A7 m; w7 }% S
{" M: j4 _5 X+ n Q
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Composite Curves failed!");
! u; N, o: p$ v return 1;
' |* A% J5 {$ s! G `. l+ _/ q }
9 W7 \+ N' f7 D# |) r, I4 D+ i vector<NXObject *> allCurves = compositeCurves->GetEntities();
) g5 J& ?8 H, b$ f2 B5 V v for (int i = 0; i < allCurves.size();i++)
! L$ J+ r( O j; s- {# f4 c0 N5 y& f {
% j1 D. [: z7 z1 ?% R" ] sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));
' L6 F/ O7 P& F% k& X- i4 K } 8 [0 t) U% |. ]7 L! v* e) O
}
9 D, ]8 h0 }& C5 x. {
) u' O# f- Q& S5 F) p3 @- \ |
|