|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
代码分享下,其实场景是这样的,我们要需要抽取一个边的线条,通过composite curve去处理,但是在非装配下,基本上是通过composite curve进行抽取,在装配下,需要通过 wave link composite curve,两个方法场景不同,这就需要进行分别判断。
, \' }. g) I3 [0 q9 e% t* S* v. C5 N
0 t: k9 n! n2 F4 K: \1 x紧紧判断是不是一个occurence还不够,因为在选择边如果零件是工作部件的话,这种情况wave link是无法使用。. b! z$ B3 ^. l
5 \5 R. k+ w7 f
if (!selectFaceGroup1.empty()&& !selectFaceGroup2.empty()&& !selecTCurveGroup.empty())
9 w; |% i; i$ P& K {6 o) j& K$ |; P2 Q
// we need add more check for the edge selection
* _3 A) H+ U& l. X C" G7 w for (int i = 0; i < selectCurveGroup.size();i++)
+ e8 p S( m7 S( ~! |! C& T {0 W7 T) }( x6 a0 P1 {+ |# G9 B
//////////////////////////////////////////////////////////////0 g1 ]2 o! m/ D7 a& v7 S2 Q3 [% Q
Edge * selectEdge = dynamic_cast<Edge*>(selectCurveGroup.at(i));
) b6 L0 w. r* R3 E$ h4 a$ e5 a if (selectEdge->IsOccurrence() == false)! D6 X8 s9 B7 m* t) n6 X l8 ]
{
4 _7 k f, w8 k* b. @( o* k selectedEdges.push_back(selectEdge);
; P4 N$ o) @1 M }
, e" x9 o% o( j: U. t else# q- _& _" o$ c. ]2 J& s2 a
{( o- F2 N' E8 w- m# u+ ]
if (selectEdge->Prototype()->OwningPart() == workPart)7 K/ T; \+ u: O
{
9 X) a( @6 D$ q( O# c* `3 m& ?# h selectedEdges.push_back(selectEdge);
# @- Z8 ?( u! b& g! j" W }
& E7 T% l, _, Y else8 x7 ^5 J, [, W( T; A1 {
{
1 _ ]0 l6 H3 W* J0 Y8 l2 Z8 | selectedEdgesOcc.push_back(selectEdge);# S1 m6 i4 a# c( |- V
}+ d. T0 e5 d( ^
}
" h; e2 e1 X2 N1 i }
5 i8 a/ }: f* e: h, q
9 y/ q5 `9 Z0 @( a
" F8 Z4 \$ [ B0 g/ \ //2 get composite curves . }3 e& p+ l- D t, A; @% V
if(!selectedEdgesOcc.empty())
}4 ]: L; [8 m" D2 p& S {% I: p% F3 ~3 M+ L) M# |
errorCode =createWaveEdges(selectedEdgesOcc,compositeWaveCurves);9 f# f+ E5 R; e
if (errorCode || compositeWaveCurves == NULL)' y$ H) |+ y1 Q3 b7 h. B
{; x1 p& v& e3 l% x" x/ Q& V
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Wave Composite Curves failed!");
% d" B( i8 t. \* g8 l! h! s$ S return 1;- q: Z+ J: q' R" e
}
$ z6 X# @/ U: R$ e% t& I6 l vector<NXObject *> allCurves = compositeWaveCurves->GetEntities();4 {& l+ j* \7 m
8 V$ d- _' c! G2 v- q4 S6 V for (int i = 0; i < allCurves.size();i++)
) _, z: d3 k _0 A2 s4 K {
6 f3 d& e6 o N5 q% n1 p sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i))); Y; x u- u4 G$ W
}
" g B; O* N9 g( `& u7 [; Z5 `% Q* \ }/ z/ B7 U. R6 _# v
if (!selectedEdges.empty())
u/ p) Q! S. o; O. k0 M6 v {3 O, ?& C2 K8 N$ w: U: a
errorCode =createCurvesFromEdges(selectedEdges,compositeCurves);/ c; ~% k/ C) ]) K: z+ S
if (errorCode || compositeCurves == NULL)
% U5 N( T; B$ t0 X4 l0 i {
! v! K- {$ j% D& O5 X CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Composite Curves failed!");
: u4 `! r- s: J2 w5 Y0 p2 g4 @! D( l return 1;! O1 |( k6 V* M9 R3 u% I5 [
}
+ z b5 z3 b6 H/ @* O" ^. [% K- { vector<NXObject *> allCurves = compositeCurves->GetEntities();
1 @4 O. z7 H$ C for (int i = 0; i < allCurves.size();i++)
" c! t2 }/ p# K0 Q+ o) `1 g {
' `. f3 I O" R% P0 D6 h sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));! r: m- W' L1 f, Q4 A4 x2 f4 W- u
} $ O% {8 n& F: _+ b
}) ?* ?9 i) u' M6 J
: n) F0 Y& }' o( G" V3 h |
|