|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
代码分享下,其实场景是这样的,我们要需要抽取一个边的线条,通过composite curve去处理,但是在非装配下,基本上是通过composite curve进行抽取,在装配下,需要通过 wave link composite curve,两个方法场景不同,这就需要进行分别判断。5 m1 w4 U/ a2 V+ S: a" ~" o% {
, n8 z% P# c4 ^* g+ c1 T4 y8 O
紧紧判断是不是一个occurence还不够,因为在选择边如果零件是工作部件的话,这种情况wave link是无法使用。% o9 n5 h; C: x! v! _' g; u! W
# ?, w. F2 U, f' G8 g6 p$ Q9 Y if (!selectFaceGroup1.empty()&& !selectFaceGroup2.empty()&& !selecTCurveGroup.empty())" V0 B% v, T; z9 s8 L
{/ F7 d: A8 ~7 i7 e. ]. Y" q
// we need add more check for the edge selection
5 M! m* a; Z6 t( } for (int i = 0; i < selectCurveGroup.size();i++)" e2 s* Y/ E1 h: ~" @* ]
{
3 o9 N. \9 d. p1 H1 V+ b //////////////////////////////////////////////////////////////
" c4 v& h+ r# r; c, @ Edge * selectEdge = dynamic_cast<Edge*>(selectCurveGroup.at(i));
" r( H5 ?% Q; Y8 U t if (selectEdge->IsOccurrence() == false)2 V- c( V8 u' i
{! g e" ~1 w0 y+ O
selectedEdges.push_back(selectEdge);
2 a [7 m: S1 N' K, S4 e1 [7 \ }
) _9 `$ w% D% j+ f0 z else' w& J$ I# e+ u- O5 e
{
. n `9 ?3 ^/ g1 p if (selectEdge->Prototype()->OwningPart() == workPart)
7 h7 d" q7 H1 ~( \: d+ y% i6 K( P {
/ K" g8 N- g$ P' h$ S/ m selectedEdges.push_back(selectEdge);8 W5 q1 k0 r& m" w B4 U
}
# ?+ l0 F" h; Q. B* b! T1 N5 g else* \' F- n8 a5 m# N. U/ m J& E" b
{9 j) }: `$ D5 n: w
selectedEdgesOcc.push_back(selectEdge);. c& Q' W- ~; ?3 G5 F
}
% h* l! P7 L# f/ s7 S* h. g9 h }
/ N# e- Z" }& A% I! y }
3 Z. B3 x1 G/ e6 d" v: ]) Z5 }7 j/ |: s' e# A O. ]0 S5 T. B- y
* r0 I( j8 i+ G! e) a- F" |
//2 get composite curves
+ {/ N. \" r1 z; I0 j6 E( { if(!selectedEdgesOcc.empty())5 Z) O% d. [8 t+ o8 z: T; k$ G( _! i" G
{
. N7 V5 Z+ `( R2 O4 | errorCode =createWaveEdges(selectedEdgesOcc,compositeWaveCurves);3 k. R% T9 W8 [; I+ \
if (errorCode || compositeWaveCurves == NULL)- x8 M* x1 C( M Y8 V9 k" F
{
& h8 W0 S2 X! _0 G8 A5 A8 M' N5 l CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Wave Composite Curves failed!");
# n9 ?! }2 f0 @) O+ F return 1;, { b H0 E- E; p! V$ }3 ?& Y
}4 K: Y o; T, D0 M2 f# F, p
vector<NXObject *> allCurves = compositeWaveCurves->GetEntities();2 H. y, X* C, J6 _. X; j4 {% O
( w J) U. e' q* W! @' x for (int i = 0; i < allCurves.size();i++), {" _. n `; p; [8 U
{8 g- t$ |0 S2 v, D9 }- A
sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));1 i& y% C& F* Z% Z' g# j
}
/ Y7 H( ?+ H& W" C }
5 D( D& |1 k3 G D n) Q+ l+ d if (!selectedEdges.empty())* D$ p; p. w1 ?- r+ d5 _
{4 E, |4 L! L- J4 W
errorCode =createCurvesFromEdges(selectedEdges,compositeCurves);
' K+ l6 }3 `* }7 q if (errorCode || compositeCurves == NULL)7 x0 h% @$ o4 a: E: }( K0 Q( @6 Y
{7 ?2 m9 q2 ~3 t
CheckDTS::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeWarning,"Create Composite Curves failed!");) [. ?- O8 G" d
return 1;% v* B/ w" C ^3 l6 [2 i/ u1 {
}
) f; ?: l( H" z8 a8 u vector<NXObject *> allCurves = compositeCurves->GetEntities();4 R c. ` A; L5 `$ _; x
for (int i = 0; i < allCurves.size();i++)
3 `: l' x8 |" y6 \8 J {
5 l* H8 M4 X0 P! ^8 H sectionCurves.push_back(dynamic_cast<TaggedObject*>(allCurves.at(i)));
! v1 }# [3 o7 O4 H1 g+ K8 N }
( x9 K# g" F, a$ v0 f }
& w0 J7 M3 f9 H7 L. c* o P8 n2 P5 C6 u+ p
|
|