|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. ] R9 Q4 V) ^( E7 t- I* T获取Super Section控件选择的对象,方法比较特殊,收藏学习
7 c: t/ K% G% m5 _$ b1 x* d) L8 s; E
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象7 p, V- o+ ]$ s8 Y3 g) T
* A: d6 F6 ^: V6 Y: ^) ^
[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection): E) x5 t2 `2 K4 Z& ~! \) F
{7 [8 }1 @9 p& C& F& E5 l) Q
vector<TaggedObject*> theSectionObjects;% d; ~. L; i C6 ?4 N7 p
theSectionObjects.clear();
( `$ D7 t$ U& l/ b! I7 p std::vector<NXOpen::SectionData*> theSectionData;
6 ?6 D& m% e, q5 X1 M theSectionData.clear();% C3 V8 s1 Y. a( k1 z
+ r7 ^% E# c$ g3 e. q% F5 v NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();
' k, P0 Z, o3 r, W( U4 E theSection->GetSectionData(theSectionData);
- y! U/ L% |7 ]7 Y% p for each (SectionData * aSectionData in theSectionData)
! e/ b H( N+ A {- E$ j1 Z J# N7 ^- k* s
vector<SelectionIntentRule*> rules;4 h v; V/ ~0 v0 s2 y/ A3 `
rules.clear();
; m1 S$ I W% [: j2 s" [ aSectionData->GetRules(rules);
; V! ?4 [! R. d. R# N" U0 j3 Y, l8 X scCollector1->ReplaceRules(rules, false);
8 e* t% a5 ]3 V: K/ X for each (auto var in scCollector1->GetObjects())% L/ M. u; f5 H: r8 K* J* @
{
: ^9 y; m; C( g' U1 { theSectionObjects.push_back(var); F L4 m8 _+ ?+ @' Q4 k
}+ O* D4 B1 Q9 Y$ T2 J
}
) H0 |) t& m1 G# d& D5 Q& @ A0 M9 G: e s6 @/ K# z1 B5 u7 h2 S
8 E: }4 z1 E. b: P. n7 i2 b' a/ X$ y8 K. P
return theSectionObjects;) [/ ~: m2 W& @+ n5 N0 F h
}[/mw_shl_code]8 |: y; F; K+ O1 ]' M& c/ T2 c
|
|