|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 H$ \6 H- f( o% K: }
获取Super Section控件选择的对象,方法比较特殊,收藏学习
" p2 z; k. o9 |% [3 A# W1 D* M3 Z9 C' ` M$ o# V
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象
& D5 z, P3 A+ Y z) @5 ]
7 L( k, Q( P& M) n[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection)
$ a2 ?) [1 M/ K, ~) |7 {5 v" P {" K a) T% e9 r
vector<TaggedObject*> theSectionObjects;
$ _8 ^, e5 R& a8 {0 i6 c theSectionObjects.clear();
' E, T) Q4 |) l std::vector<NXOpen::SectionData*> theSectionData;5 U, b0 J. Q; C. I7 O" o
theSectionData.clear();
* H" K0 W9 I8 G, d' Y
, [" i6 m- r/ X! q NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();" L% C. u# l3 x' H$ o
theSection->GetSectionData(theSectionData); m+ p9 B% Y0 y7 A* z9 @
for each (SectionData * aSectionData in theSectionData)6 c( x* ~ H% u' u0 A# n6 P
{% L* y* w4 _: ~9 P
vector<SelectionIntentRule*> rules;
+ p& C+ b& }) k/ t# k8 j rules.clear();
% v% ~: A! x& i, Z1 i aSectionData->GetRules(rules);
5 @$ B& G4 P9 X* ~7 ^+ x6 U. k) h scCollector1->ReplaceRules(rules, false);
' L* N P$ [0 m& P$ v for each (auto var in scCollector1->GetObjects())! p9 d+ f, U" w# _
{' ]1 S% n6 w! k2 I
theSectionObjects.push_back(var);1 v( l3 ]2 Z0 |+ @( ]* S
}
5 F2 B8 S. d/ E. N$ c4 r }
+ g( N! X1 ?% n$ |/ H' _8 Q2 r- Z k4 j% e' E+ G. X1 o0 P
: [( y* i% M% a$ F+ K/ j
3 r4 S8 K& J0 I6 t4 x return theSectionObjects;
* K6 k2 \% f7 l) @ }[/mw_shl_code]4 \1 s) c4 Q Y! u
|
|