|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
# u. \) u1 T2 e3 f3 J$ ?0 lNX二次开发源码分享:最简单的创建PMI Note方法
' {) L4 P" {7 U5 B6 {2 X/ ?
d. }& n) a1 S$ g3 `1 D[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)" O2 t( l7 g8 R" t9 i8 {
{
/ G V6 a" w9 o4 f- [. n // ----------------------------------------------9 R& Y. ~* c' F, k! I( q
// Menu: PMI->Note.../ `& k, Y1 J* ~& Q& z+ G$ q$ h
// ----------------------------------------------5 b# q" I0 m& B0 W) e+ z- w/ y
NXOpen::Session::UndoMarkId markId1;
. R0 A! B4 J: F markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");! _; |/ Z+ A2 r8 O
- F6 H0 e" w+ l; ?9 v
NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);2 x( @8 V# |# h6 M
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;
6 S0 k# ?, ], s pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);
- u8 n: t) ^6 f( N std::vector<NXOpen::NXString> text1(1);
, x/ v3 j" _, u text1[0] = " MI Note";3 k0 ^( o. w9 [/ p+ Z, v& w
pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
# j% M6 C; \/ ~( G pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);* G7 ]; S0 n8 Y V% |
NXOpen::View *nullNXOpen_View(NULL);3 W: }* C5 A n- q$ _
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);
6 V9 K7 l& D) M' R" B pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);1 K u5 o2 E5 x5 n* p- |+ O: x
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);4 j" W3 }. w9 Y: p& B
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
8 j M' j& l2 o" {+ l
# G8 L' F s: i6 D1 z NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();* q3 A J1 x* F5 J
pmiNoteBuilder1->Destroy();
! _5 a- V6 l; o3 S# U% P/ f6 y' I}[/mw_shl_code]6 {4 l6 J/ X5 B+ S
|
|