我不会用intersectwith这个函数 谁知道的给我改改下面的代码 Dim db As Database = HostApplicationServices.WorkingDatabase Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor '对话 Dim values As TypedValue() = New TypedValue() {New TypedValue(DxfCode.Start, "POLYLINE")} Dim sfilter As New SelectionFilter(values) '选择多段线 Dim optsel As New PromptSelectionOptions optsel.MessageForAdding = " 请选择多段线" Dim relsel As PromptSelectionResult = ed.GetSelection(optsel, sfilter) Dim sest As SelectionSet = relsel.Value Dim line1ids As ObjectId() = sest.GetObjectIds '选择图层多段线 Dim ft As TypedValue() = New TypedValue() {New TypedValue(DxfCode.Start, "POLYLINE"), New TypedValue(DxfCode.LayerName, "DGX")} Dim sr As PromptSelectionResult = ed.SelectAll(New SelectionFilter(ft)) Dim ssest As SelectionSet = relsel.Value Dim line2ids As ObjectId() = ssest.GetObjectIds Using trans As Transaction = db.TransactionManager.StartTransaction() Dim pointlist As List(Of Point3dCollection) For Each _polyline As Polyline In sest For Each _polyline2 As Polyline In ssest If _polyline.IntersectWith(_polyline2) = True Then pointlist.Add(_polyline.IntersectWith(_polyline2)) End If
Next Next End Using
|