|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; k, N* h0 J* p4 N& SNX二次开发源码分享:最简单的创建PMI Note方法
$ H+ `9 F( j1 U' P$ i$ w% ~- A( G& f5 [4 W. i" C9 [* A& F
[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)' W. V$ f0 }- I1 p+ g- a
{0 h" u3 Z! ]6 _2 O
// ----------------------------------------------
& E) Z/ r1 F8 v; i! W7 _ // Menu: PMI->Note..., b1 S4 I7 J) H# k) x! Y# x) L% t% r
// ----------------------------------------------
t6 @ R4 m0 A6 h( I NXOpen::Session::UndoMarkId markId1;
X, M, a g7 Y/ G8 ~ markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
# |5 e) w) d. L
% s9 N0 @. u9 p% n NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);
. u, e, Z- A2 |3 [' |+ ] NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;
2 Z/ U: B$ x4 u1 p- O' D' S pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);
0 [8 d, y5 E# Y5 K std::vector<NXOpen::NXString> text1(1);
7 K: s; M( |! z6 V5 T text1[0] = " MI Note";. S9 G1 G* E( ?6 Y) d9 \8 ?
pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);# N0 h" J+ h0 F( t* ]5 T
pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);
" M$ r8 S2 ^1 O: [' X) d NXOpen::View *nullNXOpen_View(NULL);
5 H5 z9 C9 ~- T0 w: J9 e pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);3 K2 y* r( v9 Z( ~% `
pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);
6 ?2 Q: j3 y) ]9 j pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);8 O u2 m* t" W: s
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);# J+ t4 v& o8 _7 I
3 @; K+ Y1 j6 ]% e' z" E: J: b* M7 n. ?: M NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();% e% ~6 |/ b. B
pmiNoteBuilder1->Destroy();
1 i5 W4 r/ _5 T7 W/ X}[/mw_shl_code]9 t2 K, _( l# ^
|
|