
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am having trouble hatching multiple "Arc & line" boundary objects. If there is ony 1 shape mape up of Arcs & Lines it works ok, but if there is more than one, it fails, any ideas why?
Cheers,
Martin.
Dim TVLn(0) As TypedValue
TVLn(0) = New TypedValue(0, "line")
Dim FilterLn As New SelectionFilter(TVLn)
' Selection Filter: Arcs
Dim TVArc(0) As TypedValue
TVArc(0) = New TypedValue(0, "Arc")
Dim FilterArc As New SelectionFilter(TVArc)
' Selection: Lines & Arcs
Dim SelLines As PromptSelectionResult = acDoc.Editor.SelectWindow(New Point3d(BrdMin.X + 2.5, BrdMin.Y + 2.5, 0), New Point3d(BrdMax.X - 2.5, BrdMax.Y - 2.5, 0), acSelFtr)
Dim SelArcs As PromptSelectionResult = acDoc.Editor.SelectWindow(New Point3d(BrdMin.X + 2.5, BrdMin.Y + 2.5, 0), New Point3d(BrdMax.X - 2.5, BrdMax.Y - 2.5, 0), FilterArc)
If Not IsNothing(SelLines.Value) Or Not IsNothing(SelArcs.Value) = True Then
' Lines grroup.
Dim LinesEnt As Entity
Dim EntCol As Double
Dim LinesCol As New ObjectIdCollection
For Each LinesID As ObjectId In SelLines.Value.GetObjectIds
LinesEnt = LinesID.GetObject(OpenMode.ForWrite)
Dim Lines As Line = LinesEnt
LinesCol.Add(Lines.ObjectId)
EntCol = LinesEnt.ColorIndex
Next
' Arcs grroup.
For Each ArcsID As ObjectId In SelArcs.Value.GetObjectIds
Dim ArcsEnt As Entity = ArcsID.GetObject(OpenMode.ForWrite)
Dim Arcs As Arc = ArcsEnt
LinesCol.Add(Arcs.ObjectId)
Next
For Each LnArc As SelectedObject In LinesCol
' For Each selObj In LinesCol
'' Hatch center peice
Dim HatchCntPce As Hatch
HatchCntPce = New Hatch()
acBlkTblRec.AppendEntity(HatchCntPce)
acTrans.AddNewlyCreatedDBObject(HatchCntPce, True)
HatchCntPce.SetHatchPattern(HatchPatternType.PreDefined, "solid")
HatchCntPce.AppendLoop(HatchLoopTypes.Default, LinesCol)
HatchCntPce.ColorIndex = EntCol
' Next
Next
End If
Solved! Go to Solution.