|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
代码分享下,其实场景是这样的,我们要需要抽取一个边的线条,通过composite curve去处理,但是在非装配下,基本上是通过composite curve进行抽取,在装配下,需要通过 wave link composite curve,两个方法场景不同,这就需要进行分别判断。
" L I2 X% G6 ]1 B1 X, R# _, }) Q3 `
; ^0 q U5 s' g; o+ {6 x& h Y" _紧紧判断是不是一个occurence还不够,因为在选择边如果零件是工作部件的话,这种情况wave link是无法使用。1 `) j1 P% A6 X. `$ ^1 @5 G
, I! U9 @2 {2 F- P m: O3 I+ l
if (!selectFaceGroup1.empty()&& !selectFaceGroup2.empty()&& !selecTCurveGroup.empty())
4 ]+ w. ]7 |7 f9 k {6 S" V2 q) Y- U ^; K
// we need add more check for the edge selection
, P1 \; T3 `; M for (int i = 0; i < selectCurveGroup.size();i++)
& O7 L4 \7 W, H K* U {
0 I& a# M6 w" J A7 O. K O, @0 z //////////////////////////////////////////////////////////////- v" Y! f) P' B, g6 u& f; @/ W
Edge * selectEdge = dynamic_cast<Edge*>(selectCurveGroup.at(i));
* t( w' i0 u1 Z if (selectEdge->IsOccurrence() == false) g% j1 B" B& c3 s s
{
3 X' D6 a$ a6 g( `" Q- | f; T selectedEdges.push_back(selectEdge);
N: {3 s0 Y- @6 C O! }( R" E }3 W s$ t c7 p$ @0 d6 M* R6 M
else& v0 A6 n; R4 r4 e8 F
{- M+ w0 O9 _# N0 e: D
if (selectEdge->Prototype()->OwningPart() == workPart)( O4 @# w* r+ Q# ^; c( Q+ e
{
6 L, d' c" M7 h: s8 `3 |' i selectedEdges.push_back(selectEdge);/ |5 j/ f! k( _7 J4 k9 e; m8 M, A
}
( P n, c/ u) R8 E( P# a8 W else7 Q9 t& _$ p( Q2 X6 a, `
{
8 y/ @+ x$ N. h( K, b7 f) ^: S selectedEdgesOcc.push_back(selectEdge);" h- o9 q& k5 z
}/ @ S/ X7 C$ n
}
) |7 y' ?: V) z, A9 H E, Q }1 T$ `5 c: o# E$ x
3 q P0 R' }" z7 E' O+ a
' q6 c/ k! Q$ C6 h //2 get composite curves 5 F5 H. C, I7 {1 G
if(!selectedEdgesOcc.empty())
7 x3 ~' X# a, ]4 b m7 ]4 A, a% N7 x {8 W# c3 ^. u$ j2 |% B& r0 K3 W
errorCode =createWaveEdges(selectedEdgesOcc,compositeWaveCurves);" _$ w* w: T V$ L1 E
if (errorCode || compositeWaveCurves == NULL)* e( Z: U! c3 v2 O) I' b
{; X# w# _# D6 \. _
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Wave Composite Curves failed!");0 I- e1 R( g" J z8 F$ x6 W
return 1;
" I/ b6 n! g( l& F0 w }
/ S; k% \$ [7 j. H0 j2 @! S vector<NXObject *> allCurves = compositeWaveCurves->GetEntities();, v4 w. S% X( x3 T
$ R! @- o U; z0 {6 [0 s for (int i = 0; i < allCurves.size();i++)
$ T$ `9 C9 g6 m* `+ U0 \8 }/ U {3 m) R& C5 C/ e( k5 d
sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));
- b$ s# h; A1 U) h9 _$ W }
0 p" C! |( H) k! Q/ v+ U* X7 { }
/ H3 K" |7 x# ?( F {% ^7 C4 i. T/ v4 p if (!selectedEdges.empty())0 C9 U$ A) N2 x& P* c
{4 k$ n6 A2 R% V0 f3 I$ U2 t
errorCode =createCurvesFromEdges(selectedEdges,compositeCurves);& `( E- p$ l' P0 D6 N1 E8 V/ ]) A
if (errorCode || compositeCurves == NULL), R$ T \: e& M; I0 q( \: s
{4 w7 t. N& K3 x" q* Y
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Composite Curves failed!");
% F* U8 o. m9 R. A. X- O return 1;4 O1 j( ]# _6 t6 V, P1 @$ \/ C6 P" |
}
! a4 G0 X1 X4 }) s" s vector<NXObject *> allCurves = compositeCurves->GetEntities();" w3 B, P1 \7 Y2 N D0 p
for (int i = 0; i < allCurves.size();i++)' h3 v1 Q# G/ X4 d
{1 u* w0 l' d" ], d2 O
sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));8 }9 G4 D$ l a7 {# {
} ( b6 g/ h4 r) o
}1 a; i- B g8 E r
+ H; |7 v" I" p: a9 o |
|