|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
' q$ U1 W4 C8 E% \
获取Super Section控件选择的对象,方法比较特殊,收藏学习, C$ O: z7 J3 W# s
5 M p& w, d u9 d0 t$ V- }9 Q
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象# V" }9 B( b& Y3 t! o* Z& F4 o
) }1 l0 E% A# v( w" n/ Q, a[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection)
7 `: G- \. E; D1 W {
6 ?( g1 h, w* @6 \ z' j$ B vector<TaggedObject*> theSectionObjects;% r5 n: q6 H6 ~2 E+ i
theSectionObjects.clear();
* a8 h* u4 g- c5 S$ E/ Y std::vector<NXOpen::SectionData*> theSectionData;
" d' W/ }; N+ o" @- { theSectionData.clear();
$ U5 l/ t/ u8 f
0 x# h8 C; r7 n# q# Q! s0 Q+ H NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();
- S+ t' O e8 Z+ f5 Q& D' f3 I' \ theSection->GetSectionData(theSectionData);
) q. h# B4 p+ }6 Z5 {5 u/ j8 r for each (SectionData * aSectionData in theSectionData)
) |' r! d' |1 I {# t0 Q# ]8 O& ?2 ?/ O
vector<SelectionIntentRule*> rules;) h+ B" J {( z' s
rules.clear();
8 |6 x* i6 N" N! c aSectionData->GetRules(rules);
" [7 a8 j, t$ j/ p- {6 i scCollector1->ReplaceRules(rules, false);
& ], s# ^' X" l1 o# s% {: k3 L for each (auto var in scCollector1->GetObjects())1 W4 a% F8 e# ?. `
{+ V- Q X: e* D" D5 S/ T) K
theSectionObjects.push_back(var);2 F0 A" J: Y% `: P, x
}- k7 L: r+ t' g, o* x9 k
}/ ?% D& y f1 g
: Z$ I; `) G% ` } B; l2 g5 Z! O ( s% X s# X5 Y( N& ~7 S
Y$ |! u" ?& j/ h
return theSectionObjects;) r8 V9 ^5 @7 z. G
}[/mw_shl_code]" V# Q- _4 S, }' a/ J4 P
|
|