|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
0 S* T# `3 q3 t. V) @' ?NX二次开发源码分享:最简单的创建PMI Note方法7 e" ]8 U6 n3 D6 R9 ?( T) Q$ k
: X- t3 T, G) ?[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)
% a" x$ N% {0 w{
9 W+ \$ j% I1 g: v7 y // ----------------------------------------------8 a& L0 R( I; T P: o) n# S3 s7 Z
// Menu: PMI->Note...
$ a# _; Q5 \( F' F // ----------------------------------------------1 e& {, \6 @/ J
NXOpen::Session::UndoMarkId markId1; p6 [- k' I- V6 z% U
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");6 e" a* P# h4 t0 C6 x8 E
9 |( L2 C1 D9 c: }# M9 M
NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);2 `: J* p/ _2 t1 x! X# O
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;4 B1 e) V5 c5 e( u
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);! r! Y: ^8 ?4 S$ i1 o" J
std::vector<NXOpen::NXString> text1(1);
% ~# z' f; R" S7 r, i$ _8 o: p text1[0] = " MI Note";
X! x2 s8 u# `1 {0 y/ Z pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
2 ~5 }8 X* ?+ o8 r% w2 [" ? pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);3 ]* L" j# g; X& R s( j+ L1 H! D
NXOpen::View *nullNXOpen_View(NULL);' _: K, T4 A) K! N6 |- D8 n9 ]; c
pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);# `$ A- ]; Z% y5 x* c1 k5 e* J
pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);; a) _. U; n4 c, y# p
pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);' m0 U- ]: F& V
pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);
K, s( C ~4 s7 u" T5 ^2 V! \4 d
m5 ^ K+ r4 @/ a- L NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();% ~4 i6 t1 R( Y5 N/ {& e) E
pmiNoteBuilder1->Destroy();
& Y3 ^6 Z1 ?9 y* m O3 s/ ?}[/mw_shl_code]
Q0 z! W8 `/ a/ j; t6 r |
|