|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
) ?( M7 T3 G4 ?/ O8 D+ A4 g
获取Super Section控件选择的对象,方法比较特殊,收藏学习
- f3 ]* d7 k( a6 s# C1 I N, Y2 o, c2 s# V" F3 Y; L [! x
直接使用getoutpuTCurves是有问题的,这个只是临时的对象,需要通过下面的方法来获取选择的底层对象
' j4 R' V& p) f6 S1 S7 V7 R7 x% \/ q( E+ R* ^$ R1 r
[mw_shl_code=cpp,true] vector<TaggedObject*> GetObjectsOfSection(Session* theSession, NXOpen::Section* theSection)
. i8 I2 p' D0 g- {0 i2 X& C7 T" S! B {/ L6 ~" }$ D5 d# x1 Z7 I7 `* p
vector<TaggedObject*> theSectionObjects;
# ~; H {# X& _+ ^' m6 F2 r theSectionObjects.clear();* L% `, x: y1 P- n
std::vector<NXOpen::SectionData*> theSectionData;. \6 S- }. V- Y g. K- C7 X6 L
theSectionData.clear();
$ X+ F3 z6 v8 N+ H* d4 |) X% H
|) w; X# r" e NXOpen::ScCollector* scCollector1 = theSession->Parts()->Work()->ScCollectors()->CreateCollector();; @4 A. g6 s" L! t% J# F9 s% ^
theSection->GetSectionData(theSectionData);; O' T+ H! P' |# m5 V
for each (SectionData * aSectionData in theSectionData)5 ~0 n( t2 E$ v3 Q! y/ s
{. j% G4 W3 t; _5 r8 i0 K. D7 z
vector<SelectionIntentRule*> rules;7 M! }( Q5 x0 [; O# `% d3 _) E
rules.clear();
" M; E2 o3 @: v& L' |2 x; { aSectionData->GetRules(rules);
& ^4 m' A1 Q# R G5 W5 a1 v4 U# G scCollector1->ReplaceRules(rules, false);6 Z2 \# J5 Y% t* Q
for each (auto var in scCollector1->GetObjects())
; d! v% f$ s, B8 G/ N {
2 {: M3 U- g) C1 ? theSectionObjects.push_back(var);
' m E. L1 V1 x3 X }
3 [! \0 q" @ c0 t$ T) a* \ }
! X- w4 a) S* l9 \& ]8 f0 U0 V0 K Q Y# n8 Q# i9 `- {) d: b
+ C0 F4 |0 `" | E5 X4 j4 u
2 Y m0 D/ l( ?, t( o; C; u) j return theSectionObjects;& s. k: n J+ ^7 Z$ x
}[/mw_shl_code]
9 |5 y/ i$ X& r* W! u9 X6 V: f9 L |
|