|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
_7 d# @ F! ^6 W* t7 w6 F1 ANX二次开发源码分享:最简单的创建PMI Note方法
) h2 s r4 f' T% W9 [! h; _9 m- v9 ?6 j
[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)
" t/ G2 m C) p! {0 z) i{
: I+ x& |# x" V: g4 B0 p- Z // ----------------------------------------------
]/ \, ]4 q* F# a5 X // Menu: PMI->Note...
$ [0 e1 G- a; a; _ // ----------------------------------------------. Q2 s7 d( \1 P6 W Y7 ~7 O
NXOpen::Session::UndoMarkId markId1;
' X0 ]1 N& j. A markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");0 ^0 N: R8 R, E! |
% j* i3 X8 L. V3 A1 K, w0 \& Z NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);' p) D# ?$ O) r9 ~* p7 o2 m" k
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;6 Y7 f" c7 T# O" U- a
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);* i9 t! a. S* C9 D
std::vector<NXOpen::NXString> text1(1);1 w5 `6 J+ W/ b2 u
text1[0] = " MI Note";
, {/ C, S4 x, G! n pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
/ s& W0 \( o7 x pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);
5 w; n$ w1 d; H. G8 e" N NXOpen::View *nullNXOpen_View(NULL);) R2 p3 S; N' M# m' c* Z
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);
: o2 k2 [5 h; f pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);& W; l# ^$ f- u& J
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);* I& Z5 I7 I* N5 U8 n
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
/ ] R7 |: b( u) Y- b0 N' n) u+ }( g3 ]* A! @
NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();+ W& I; [1 @/ L: P! f! p
pmiNoteBuilder1->Destroy();: U n( @+ ?8 o# A) F3 p
}[/mw_shl_code]
9 _2 A0 w1 U& a3 G% r |
|