|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: v5 s, a0 F1 e1 U4 d7 A
6 W* x0 j8 i" X" I9 j; {1 c' C' {
其实主要是Note的类型的定义问题,参考代码如下:
1 x7 f9 M/ s* p6 y9 g$ K H" d" d f) T ^! x
& g8 N0 H! e4 T* U# i: _
Private Function selectNotes(ByVal prompt As String) As Annotations.Note()# |( e e2 n: [# M9 A# e0 z& Z! V
Dim mask(0) As Selection.MaskTriple
0 K/ @& ^: Q; n) v! P3 m* D% e With mask(0)4 i# w* e% s. L0 c2 P* l
.Type = UFConstants.UF_drafting_entity_type
$ j4 y. |) s4 v6 D; z; `! C .Subtype = UFConstants.UF_draft_note_subtype
' C' Y) e* @/ d+ ^2 l .SolidBodySubtype = 0
6 S: I' ]8 {. i8 J# ^. A* o End With% F$ {" ~: O+ Q" [
Dim cursor As Point3d = Nothing( X& [( U7 q! ?$ c _6 H
Dim theObjects() As TaggedObject = Nothing
, F3 i& t7 n/ S+ A! \4 }5 ]
! n3 A# z- _, q0 z$ i UI.GetUI().SelectionManager.SelectTaggedObjects("Select Notes", prompt, _
Y, T4 e l' ]: ]* j3 [* j+ g9 i Selection.SelectionScope.AnyInAssembly, _& n6 g5 b% ]4 P( }
Selection.SelectionAction.ClearAndEnableSpecific, _
8 t! H/ R4 D; T1 \4 k False, False, mask, theObjects)
. V2 j" _% a, L; T% I9 J Q
) X% b% V! L* h* p- ? r Dim theNotes(theObjects.Length - 1) As Annotations.Note. o% D6 Y, h- D, O* @4 B% A
For ii As Integer = 0 To theObjects.Length - 12 ^; j* P/ s, m1 r! W+ b& ~
theNotes(ii) = CType(theObjects(ii), Annotations.Note)
' o! b$ [1 s, m: r3 e Next( w1 x8 ~% ]" x+ g. s+ w2 K6 _% u
9 E& ?( t/ x" i
Return theNotes
. r# n2 m! f( P) x* T
/ ^& l: ]- [$ K! {; Y2 Q End Function% X D$ ~- r# d% D; P2 y
) y) Q( j+ d1 c5 I- \( K
|
|