|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ W- c+ t k, y& t O0 MNX二次开发源码分享:最简单的创建PMI Note方法- e2 d1 E3 @; g9 e' y
5 P" { E9 m! B' G6 {[mw_shl_code=c,true]void CreatePmiNote(NXOpen: oint3d &pt)
( V/ ]: ], v& J( p# Q, h* C{
, A3 W1 T9 u$ L // ----------------------------------------------
w( {! w/ Q5 a2 | // Menu: PMI->Note...
0 D) C- i# W3 k$ Q // ----------------------------------------------6 ]' N2 E( _9 e$ A1 v
NXOpen::Session::UndoMarkId markId1;% B6 V' i1 i. f" x& t( L, V# @+ p
markId1 = m_session->SetUndoMark(NXOpen::Session::MarkVisibilityVisible, "NXOPEN_PMINOTE");
2 M' p! w. a* X0 ]1 A0 G& x
& g3 Y( w6 A: U/ G! s NXOpen::Annotations::SimpleDraftingAid *nullNXOpen_Annotations_SimpleDraftingAid(NULL);1 q$ x' Q5 j1 q! l, D. ~
NXOpen::Annotations: miNoteBuilder *pmiNoteBuilder1;" y- L- @* c A& q
pmiNoteBuilder1 = m_wpart->Annotations()->CreatePmiNoteBuilder(nullNXOpen_Annotations_SimpleDraftingAid);
* T/ r* ]% Z3 f7 T: |+ o6 f. s# w std::vector<NXOpen::NXString> text1(1);* h) k. g; E/ [ `
text1[0] = " MI Note";
e7 ?! b9 p% f$ Q* T pmiNoteBuilder1->Text()->TextBlock()->SetText(text1);
7 V3 j6 l3 L) r. k z pmiNoteBuilder1->SetTextAlignment(NXOpen::Annotations: raftingNoteBuilder::TextAlignBelowTopExtToMax);
4 @' }2 {2 V! v9 G, a9 _ NXOpen::View *nullNXOpen_View(NULL);
/ _3 j% b/ K) S) N# N5 ]& R pmiNoteBuilder1->Origin()->Origin()->SetValue(NULL, nullNXOpen_View, pt);0 D1 ~( u# z5 c2 B
pmiNoteBuilder1->Origin()-> lane()->SetPlaneMethod(NXOpen::Annotations: laneBuilder: laneMethodTypeModelView);
- U, W# N& V" K* P0 f7 X pmiNoteBuilder1->Origin()->SetInferRelativeToGeometry(true);
8 ?9 S& a2 ]8 b7 _! i5 R0 l7 ] pmiNoteBuilder1->Origin()->SetAnchor(NXOpen::Annotations::OriginBuilder::AlignmentPositionBottomLeft);8 _& G* C6 o' }# r3 S |% C' s
8 x, q5 Z @; K NXOpen::NXObject *nXObject1 = pmiNoteBuilder1->Commit();
$ X% X5 V0 p" a/ @# g5 V: _7 N2 y pmiNoteBuilder1->Destroy();
; `2 s' c0 y: T; {; h6 o3 u/ L% z}[/mw_shl_code]5 [) B) R" a' @" x1 M; Y
|
|