|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
/ \1 H$ x2 s. Q1 v, ?NX二次开发源码分享:最简单的创建PMI Note方法
* s& L8 ~2 P6 r/ u! K$ o A# X6 j3 z
[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)
, D% Y3 H/ G) \{4 J* x: \. o. X
// ----------------------------------------------$ v J7 W, K" m* i( Z
// Menu: PMI->Note...: A- H& a' b& X$ ~3 I* m7 ~3 ]
// ----------------------------------------------+ ^9 v1 B( A( B
NXOpen::Session::UndoMarkId markId1;4 o- L" V# L6 C, o D2 m2 J- d4 _
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
8 q( j0 @. r+ x" K& c7 a
# F4 s+ _) b$ f NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);
5 s/ C) e( r/ @) l/ M NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;3 C$ M9 y. C% N0 x2 l# z
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);5 W1 X% Y. V7 V! G
std::vector<NXOpen::NXString> text1(1);
; E9 B/ T& M1 X4 A! s4 k+ P* J text1[0] = " MI Note";1 x# o( F B, k' y, s$ t) b4 I" q
pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
- Z' t9 f o/ a# i pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);
' ^' O" R+ k" l k2 o8 H NXOpen::View *nullNXOpen_View(NULL);
% l1 W/ \4 Z! b% [6 Z' Y pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);8 @4 j" D( O8 t: m+ d f% ^ |
pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);9 V$ Q. d1 Z9 d
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);1 v4 J6 \2 I3 S( L) p t' ]
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
. |! r/ m3 [9 T, _% `! d5 `
7 v' I+ H% y* g. ~. H F) x NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();
9 m+ d8 @4 }7 N4 q: @ pmiNoteBuilder1->Destroy();
$ s' N% u0 j* b- {}[/mw_shl_code]& S7 }, A- w, I
|
|