|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ o* O0 X/ j- @( i, l) e# D1 A9 R
获取Super Section控件选择的对象,方法比较特殊,收藏学习
+ k; m: s( g# k, _4 ]# I% K, D+ z5 m/ S( q
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象8 r& M* N6 g) X4 H1 F1 I( @/ q# E
6 D# J6 {9 `& I( y* a[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection)
# Y' ^7 |5 f/ H1 w# p, ]3 O2 Z {) i0 {* s; ]. H; `% B
vector<TaggedObject*> theSectionObjects;4 G) t" Y, H# ~
theSectionObjects.clear();
& z+ }" z! r0 h% y, w' o/ K std::vector<NXOpen::SectionData*> theSectionData;8 y7 q' n6 C1 s
theSectionData.clear();' s [' j! C) y% D
0 o# E6 v$ n1 h( Q$ z- H
NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();
0 A; d7 n/ T8 \ theSection->GetSectionData(theSectionData);. V0 v' \6 z& e( q% }; J/ l! h
for each (SectionData * aSectionData in theSectionData)
- }' y" }0 C0 {7 R# X {3 x# a; b, U$ C8 Q% R# o3 d) y Q2 S! R
vector<SelectionIntentRule*> rules;
- [$ U5 m* j6 U rules.clear();
% t# B5 X [0 ~7 S aSectionData->GetRules(rules);
_+ D+ j) o* K8 U$ ?% {( b" b scCollector1->ReplaceRules(rules, false);
# ~8 l) ?! {7 W for each (auto var in scCollector1->GetObjects())+ d4 f; d1 c% m/ ?! h- J7 Q& J
{8 S7 Z/ o: l+ Q a
theSectionObjects.push_back(var);
' G- O& U3 P9 x4 r }
7 u, g" L( ?% Q* u. j }
5 H. L# c, z9 c ~# ]0 A I& z2 K! U v [! w" W( S+ \& \
6 {1 R" ~. x; a& Z5 h/ M
5 h1 c. q8 G" P7 J return theSectionObjects;
: ]: U2 w, S# }6 d/ a }[/mw_shl_code]$ |; s1 U7 H; N" g8 t
|
|