|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 H( C) t9 u# s; cNX二次开发源码分享:最简单的创建PMI Note方法
* Q( l) l) d F; a
: h; x4 J( T4 r/ N v5 a[mw_shl_code=c,true]void CreatePmiNote(NXOpen:oint3d &pt) D8 ?1 _) x9 r& i! F: {. f: q
{- ` p: @/ M: O \8 a i& X+ u
// ----------------------------------------------
6 q) @5 Y0 l$ p) `$ @% a' G // Menu: PMI->Note...! }& T! G* I. N; T5 U# ?: M, E
// ----------------------------------------------
+ O' J5 M8 t; i* F6 ]' f+ _& L NXOpen::Session::UndoMarkId markId1;) J3 ?: V; t+ z
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
7 e. ]. V; r8 p6 A0 [. G3 W* A
4 u2 E& ^' _4 ~) n/ c" c' Z5 K& E NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);
+ i' p) n \$ |4 I9 H& g NXOpen::Annotations:miNoteBuilder *pmiNoteBuilder1;& x8 \, g/ S! G
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);- i5 C5 P# g' k0 t9 E
std::vector<NXOpen::NXString> text1(1);8 V- Z) C( _( {5 Y3 d9 j% T
text1[0] = "MI Note";
6 y4 H9 a; f) {: @ pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);0 w; v3 K5 G# x; R5 A* L
pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations:raftingNoteBuilder::TextAlignBelowTopExtToMax);! ?: o: V1 j# J6 L( P8 L# B& b9 W0 v9 e
NXOpen::View *nullNXOpen_View(NULL);9 x0 ^7 K% Y) l& H% c' r4 g1 U ~5 P
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);* Z, p+ i# Y' W. q3 G% f, P
pmiNoteBuilder1->Origin()->lane()->SetPlaneMethod(NXOpen::Annotations:laneBuilder:laneMethodTypeModelView);: j0 L/ r# @- E: w
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);. }6 @8 e( h6 @' I; K1 V# G
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
3 h) n o7 K* v: g, m( p% i6 I, _1 D2 P! C3 C, x
NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();
3 [/ y, N; |5 N4 X! ~, @ pmiNoteBuilder1->Destroy();6 L0 K8 q' T) p* R. g3 @
}[/mw_shl_code]+ C1 Z9 q m% O- P2 w' q
|
|