|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; @0 [% n0 H5 L& d9 A获取Super Section控件选择的对象,方法比较特殊,收藏学习
! P: x- P1 @# D5 `( K/ C, L e6 x. [) M: U( F3 N
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象
9 d3 a3 e1 y; u/ N a
I: g& R. d% F, I, j7 D$ o[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection)
3 E- P6 E A9 h3 m2 D( Z; X- O {
6 b2 `" O# l, I% e" T6 i* C0 `9 X vector<TaggedObject*> theSectionObjects;, O( {2 z! B) k/ U
theSectionObjects.clear();
w% S& E+ F9 f3 p ^. v std::vector<NXOpen::SectionData*> theSectionData;& O% W) ?" A0 U* T) j
theSectionData.clear();6 ~6 ?5 S2 T9 g5 z: @
: D. c* l7 p- g% Y
NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();
& l3 A, g( w6 f/ s, L theSection->GetSectionData(theSectionData);' Y8 R5 i, y e, T- k+ C; n
for each (SectionData * aSectionData in theSectionData)
$ j+ r6 k5 f! ^9 e% W8 n" U {) r- b5 Z& f& j. w* N3 ^
vector<SelectionIntentRule*> rules;
* d8 `: v E' P6 O8 S2 [" F0 J rules.clear();
2 K% l8 k/ t: `' j# q% |( g aSectionData->GetRules(rules);
) k1 _* a c4 I! r3 X- L8 e scCollector1->ReplaceRules(rules, false);( {2 @) I( ^$ F3 x5 P8 f
for each (auto var in scCollector1->GetObjects()). h0 V5 D& t5 G; E) Y% u
{
' a, r i7 W0 g6 M7 O theSectionObjects.push_back(var);: q! B2 m4 o4 ^9 G
}
( B3 _& e+ s0 O2 P }
4 K0 a* R& Z) |0 @/ q: w
4 J4 E' Q" i/ H# m( i o$ d' `6 N 1 L/ Y# i9 t& V1 G p
. p/ p0 s+ h5 r! f/ g* r+ h. t
return theSectionObjects;
! f1 J' g% a6 P; D: y j }[/mw_shl_code]* [& }8 d" b4 p+ h
|
|