|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 O* P; z% | ONX二次开发源码分享:最简单的创建PMI Note方法4 b% u: d) D) V7 _/ N- |
! a0 F2 `' ?% i/ B ]5 F
[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)
J* [: ?6 V$ e{) M8 l, T' {7 S" j
// ----------------------------------------------
9 r( B3 E- B4 F& f% z' ] n5 g // Menu: PMI->Note...
; Q/ x; ^+ k# G+ V( Z) e // ----------------------------------------------( J0 C+ g" @* t# @, ]
NXOpen::Session::UndoMarkId markId1;4 P2 n3 V" v5 Q! O% O
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
$ p% U* ~8 \/ y8 K9 n4 i: k1 G& c* r
NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);1 a* {/ n, D0 g& g( P3 ^; p
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;
. T; ]$ G( M- M2 {3 \ pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid); q2 j3 Z1 z, a6 p9 \$ y7 B
std::vector<NXOpen::NXString> text1(1);
6 ?6 ^ Z9 ]8 t text1[0] = " MI Note";
; {8 V* D' n. `. \5 l pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);! u" @4 u+ ~; B/ n
pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);
1 l4 i# w" x2 E8 s3 r9 } NXOpen::View *nullNXOpen_View(NULL);8 y7 {; m9 n- U( z1 t; W# g+ k
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);$ T. K [2 a( H& W3 I! B
pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);
+ X; M1 S* x4 k- L( m pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);
# X! M+ }5 m9 \ ?3 @+ f8 B5 f1 x, h pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);$ i1 Y2 ?3 H; t, V& J/ O5 M
/ D6 d# j d! B: k! M! O# c NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();4 b2 ^5 h, x: {1 z
pmiNoteBuilder1->Destroy(); K2 X2 `9 k. H0 r; F! T* L
}[/mw_shl_code]
; X! k1 H4 o+ C) V0 A |
|