|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: ?- G- J' G3 F( }/ CNX二次开发源码分享:最简单的创建PMI Note方法
5 `1 n- l! P3 o; g. ]/ k, g4 O, _+ e5 c
[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)) W, q+ Y: T- z1 v0 _/ ^* _4 [
{
. V* h6 ?* E* Y) P) W, X // ----------------------------------------------3 U8 h& J% z, ?
// Menu: PMI->Note...3 b, A, }8 h4 y3 @4 j5 t5 |
// ----------------------------------------------
/ G' n& Q6 S; g% Z# w3 Z NXOpen::Session::UndoMarkId markId1;+ N, G) z% Y6 o k( }1 ^
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");& L+ A& @+ p8 v. j0 m9 v$ _, [. N
9 s6 ~& Z- {5 @6 J& s+ N
NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);) {# P0 E' N1 u' s& d0 \% O9 |, I
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;# K7 S6 Y8 |& B
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);
; D6 d5 N) R4 |, Y: E5 | std::vector<NXOpen::NXString> text1(1);: I* b6 Z) a! _: f& k& e3 I4 g
text1[0] = " MI Note";
9 d( k# O9 E8 F- n# X, ]( w! Z1 L pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
( c( g$ @2 S$ o1 w pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax); W1 `( h- c8 W Q
NXOpen::View *nullNXOpen_View(NULL);- Z5 R5 H8 z& R
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);
! w6 s+ m; Z+ b1 [( o# H" m pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);% }% @! S; m9 B$ Y/ ^7 J
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);3 Z% g6 P6 M) {! f6 Y: \5 Q
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
0 L( y' }8 D' k- `: Y* V. f, \7 ]8 m0 V% _; U0 Y5 _- ^
NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();8 d+ [% k, x7 s: q
pmiNoteBuilder1->Destroy();+ A, B' A' O p: T) Y! P1 b5 ^
}[/mw_shl_code]
/ b7 w' P3 G6 o x3 V |
|