Ok, I have been toying around with setting up the majority of our blocks to use multiline attributes in blocks where it makes sense. The issue I am running into is that when I insert the block via .Net, the multiline attributes come in on top of ALL linework. This does not really work for me at all. So I started digging around and found that this is a quite common issue. Kean Walmsley has a decent post in C, and I was able to convert it all over and get it working for the most part, but the mulitline attributes will not change the draworder regardless. Below I have my current iteration of the function I am using where I bring my linework to the top as opposed to sending the attributes to the back. At first I figured that there was something I was missing considering it is a Dynamic Block I am trying to "fix" but, it works just fine except when trying to bring the line to the top of the multiline attributes. I have verified that the block is setup correctly. Are any of you doing this with any of your blocks? Or is there a method to where I can create an ever changing wipeout that adjusts height and width to the multiline attribute? I am trying to refrain from heading the hatch background route, and I don't think I'd like to start putting borders around all of attributes. Open to suggestions and ideas though.
Private Shared Function _MoveLineTop(_Trans As Transaction, _IDColl As ObjectIdCollection) As ObjectIdCollection
Dim _BlkRecIDColl = New ObjectIdCollection()
Dim _SpecClass = RXClass.GetClass(GetType(Line))
Dim _BTRIDs = New ObjectId(_IDColl.Count - 1) {}
_IDColl.CopyTo(_BTRIDs, 0)
For Each _BlkTblRecID As ObjectId In _BTRIDs
Dim _BlkTblRec = DirectCast(_Trans.GetObject(_BlkTblRecID, OpenMode.ForWrite), BlockTableRecord)
Dim _Line = New ObjectIdCollection()
For Each _ID As ObjectId In _BlkTblRec
Dim _AttEnt = DirectCast(_Trans.GetObject(_ID, OpenMode.ForRead), Autodesk.AutoCAD.DatabaseServices.Entity)
If _AttEnt.GetRXClass().IsDerivedFrom(_SpecClass) Then
_Line.Add(_ID)
End If
Next
If _Line.Count > 0 Then
Dim _DOTbl = DirectCast(_Trans.GetObject(_BlkTblRec.DrawOrderTableId, OpenMode.ForWrite), DrawOrderTable)
_DOTbl.MoveToTop(_Line)
Dim _BlkRefIDs = _BlkTblRec.GetBlockReferenceIds(False, False)
For Each btrBrId As ObjectId In _BlkRefIDs
_BlkRecIDColl.Add(btrBrId)
Next
Else
_IDColl.Remove(_BlkTblRecID)
End If
Next
Return _BlkRecIDColl
End Function