
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to write a routine in vb.net that will find all of the Multileader objects in a drawing and then set the background mask of them to true. The code I have so far captures all of the multileaders, but when I try to update the BackgroundFill to True, it doesn't do anything. Here is the code I have so far:
<CommandMethod("SelectAllMLeaders")>
Public Sub SelectAllMLeaders()
Dim myDWG As Document = DocumentManager.MdiActiveDocument
Dim myEd As Editor = DocumentManager.MdiActiveDocument.Editor
Dim myTVs(0) As TypedValue
myTVs(0) = New TypedValue(DxfCode.Start, "MULTILEADER")
Dim myFilter As New SelectionFilter(myTVs)
Dim myPSR As PromptSelectionResult = myEd.SelectAll(myFilter)
If myPSR.Status = PromptStatus.OK Then
Using myTrans As Transaction = myDWG.TransactionManager.StartTransaction
For Each myObjectID As ObjectId In myPSR.Value.GetObjectIds
Dim myEntity As Entity = myObjectID.GetObject(OpenMode.ForWrite)
Dim myLeader As New MLeader '= myEntity
myLeader = myEntity
myLeader.MText.BackgroundFill = True
Next
myTrans.Commit()
End Using
Dim mySS As SelectionSet = myPSR.Value
MsgBox(mySS.Count)
End If
End Sub
Solved! Go to Solution.