|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
q9 {/ a& D! {& g. E" Y \, ~8 z
NX二次开发源码分享:最简单的创建PMI Note方法1 g8 U, P2 C" H/ J J* E
- a' w3 }, o- C# d; B" f" U+ J I
[mw_shl_code=c,true]void CreatePmiNote(NXOpen:oint3d &pt)+ v* F' K" M6 g2 `1 q
{
$ L& }* V# S }# Q9 ?3 g // ----------------------------------------------
4 `1 w$ Y- t& r) f3 L // Menu: PMI->Note...1 T5 p5 ^$ @0 q# V
// ----------------------------------------------
. o. e; m6 W4 w; T7 H NXOpen::Session::UndoMarkId markId1;
& b7 A+ b4 e" V4 U# r markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
! m6 o: v8 F. I6 k
6 j, c6 O" t* v% A2 T NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);3 W9 W9 o/ u" p& V* U
NXOpen::Annotations:miNoteBuilder *pmiNoteBuilder1;
. |% q1 A0 I+ i* V4 H pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);
+ r& ~* W' k$ I0 i std::vector<NXOpen::NXString> text1(1);
9 a: ^% l1 e7 P% s* w: m4 h text1[0] = "MI Note";3 v6 w" m6 n0 i( H" u* \
pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
- p" M% z) t% r pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations:raftingNoteBuilder::TextAlignBelowTopExtToMax);) E% p- @# L) l. f n
NXOpen::View *nullNXOpen_View(NULL);
% F3 _5 c8 T& a pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);
$ \, O( m% `+ d% ~ pmiNoteBuilder1->Origin()->lane()->SetPlaneMethod(NXOpen::Annotations:laneBuilder:laneMethodTypeModelView);
0 |6 P4 x2 R" N% P- H pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);
3 r! m4 f$ `3 S& ?4 Y$ m pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);! Y9 J7 ^# p" \! k4 M
1 Z7 p, X: e% D+ B+ Z
NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();. M; A0 m% V5 w
pmiNoteBuilder1->Destroy();
4 `! l& D: z+ g7 \, z3 S# g}[/mw_shl_code]8 y. b. f2 K. E% w8 A( m
|
|