5 T6 L2 y% F3 M' x
' o" @+ ]4 c' m/ y8 h9 y/ L3 h8 H
其实主要是Note的类型的定义问题,参考代码如下: 0 n& x5 B5 E2 A; y7 v& w3 c) q8 s7 e* ~: _8 `
: G# h) a9 X \ Private Function selectNotes(ByVal prompt As String) As Annotations.Note() ( C1 T" x: A- w0 {* z Dim mask(0) As Selection.MaskTriple ! M3 _* P5 J- x1 O( Q) s With mask(0) ! q, g8 u0 `( j* u* I& g- J) U: O4 L .Type = UFConstants.UF_drafting_entity_type % K9 }7 Z9 E4 a/ X) d" Y .Subtype = UFConstants.UF_draft_note_subtype# x7 z. T4 i! ], \$ J
.SolidBodySubtype = 0 ! f6 \+ b: g$ g( e2 t4 A* M. w End With- c% G7 k1 y+ O: ^% c
Dim cursor As Point3d = Nothing 5 @5 l2 b' Y1 l* C! u) K Dim theObjects() As TaggedObject = Nothing . d- ]( r9 p/ |) w( ^; d9 o 1 h/ P4 P! c8 ~9 r: W UI.GetUI().SelectionManager.SelectTaggedObjects("Select Notes", prompt, _" @ r0 H" R, j
Selection.SelectionScope.AnyInAssembly, _4 @/ t* o' J9 O+ Q$ E6 n
Selection.SelectionAction.ClearAndEnableSpecific, _ 0 ^& \: g2 R- c' K$ S- n False, False, mask, theObjects)7 j/ j1 e: K6 ~: o
4 R; c2 J! d" ^* i, _ Dim theNotes(theObjects.Length - 1) As Annotations.Note ( h. l# }& q/ [3 [8 A4 L, w For ii As Integer = 0 To theObjects.Length - 1% N8 U3 R" M+ F- K: g, p) N
theNotes(ii) = CType(theObjects(ii), Annotations.Note)+ x8 W& l# l' o( {' b6 D0 f
Next + P* l m. W3 F$ p- {4 V6 x2 `) d6 X5 a8 ?
Return theNotes, w( g" l; j3 l
- {2 s( [) t& @ End Function 7 @) l8 `5 L6 _% O( T7 y0 M2 ]! v d# t. W+ i7 I" |( f/ O