Hi,
I'm trying to find way how to create button (selectAllNotes) to add all object with specific parametres (for example all annotation notes in layer 41) to previous selection block (selectNotes) in block styler dialog.
Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
Try
Dim theWorkPart As Part = theSession.Parts.Work
Dim theUfSession As UFSession = UFSession.GetUFSession
Dim curDrg As Drawings.DrawingSheet = theWorkPart.DrawingSheets.CurrentDrawingSheet
Dim drfViews As Drawings.DraftingView() = curDrg.SheetDraftingViews.ToArray()
If block Is selectNotes Then
'---- Enter your code here -----
ElseIf block Is selectAllNotes Then
Dim visibleObjects() As DisplayableObject
visibleObjects = theWorkPart.Views.WorkView.AskVisibleObjects
For Each memView As Drawings.DraftingView In drfViews
Dim dispObjs As DisplayableObject() = theWorkPart.Views.WorkView.AskVisibleObjects()
For Each aDispObj As DisplayableObject In dispObjs
If TypeOf aDispObj Is Annotations.Note Then
If aDispObj.Layer = 41 Then
selectNotes.SetSelectedObjects(aDispObj)
End If
End If
Next
Next
Problem is, that SetSelectedObjects needs to value of type TaggedObject(), but aDispObj is type DisplayableObject. Can I convert somehow type of this object?