明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1939|回复: 1

谁能帮我改改

[复制链接]
发表于 2010-4-26 17:30:00 | 显示全部楼层 |阅读模式

我不会用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

发表于 2010-4-29 16:28:00 | 显示全部楼层
PolyLine有IntersectWith 方法吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 12:33 , Processed in 0.161791 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表