As far is i know there are no limits.
I have a working hatch module that works with a Selection Set with multiple filter settings.
This is what i use in VB, i think you can rewrite it to C#:
Public Sub Arceer(ByVal oDXF As String, ByVal oVertaal As String, ByVal oPatern As String, ByVal oRed As String, ByVal oGreen As String, ByVal oBlue As String)
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acDocEd As Editor = acDoc.Editor
Dim acCurDb As Database = acDoc.Database
Dim acTypValAr(1) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.Start, "*POLYLINE"), 0)
acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, oDXF), 1)
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)
Dim acSSPrompt As PromptSelectionResult
On Error GoTo Einde
acSSPrompt = acDocEd.SelectAll(acSelFtr)
Dim acSSet As SelectionSet = acSSPrompt.Value
If acSSPrompt.Value.Count > 0 Then
MaakLayer(oVertaal, True, oRed, oGreen, oBlue)
For Each oSel As SelectedObject In acSSet
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Dim acObjIdColl As ObjectIdCollection = New ObjectIdCollection()
acObjIdColl.Add(oSel.ObjectId)
Dim acHatch As Hatch = New Hatch()
acBlkTblRec.AppendEntity(acHatch)
acTrans.AddNewlyCreatedDBObject(acHatch, True)
acHatch.SetDatabaseDefaults()
acHatch.SetHatchPattern(HatchPatternType.PreDefined, oPatern)
acHatch.Associative = False
acHatch.AppendLoop(HatchLoopTypes.Outermost, acObjIdColl)
acHatch.Layer = oVertaal
acHatch.EvaluateHatch(True)
Dim Dot As DrawOrderTable = acTrans.GetObject(acBlkTblRec.DrawOrderTableId, OpenMode.ForWrite)
acBlkTblRec.DowngradeOpen()
Dim oHatchID As ObjectIdCollection = New ObjectIdCollection()
oHatchID.Add(acHatch.ObjectId)
Dot.MoveToBottom(oHatchID)
acTrans.Commit()
End Using
Next
End If
Einde:
End Sub The variables sended to the procedure:
oDXF = The Layer where the polylines are on
oVertaal = The layer where the hatch would be on (created by MaakLayer)
oPatern = Paternname of the hatch (solid, ansi31,...)
oRed,oGreen,oBlue = the RGB color of the hatch, you can change the code easely to use a normal color.
Hatches draweorder are send to back.
Hope this one helps.
Grtz
Peter