乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 47|回复: 4

找不到什么书,只有求助大家了!IntersectWith怎么用啊?

[复制链接]

2

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
10
发表于 2006-6-8 20:43:00 | 显示全部楼层 |阅读模式
能详细讲一下吗?谢谢了
回复

使用道具 举报

1

主题

157

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
161
发表于 2006-6-9 14:00:00 | 显示全部楼层

IntersectWith Example


Using Programming Languages other than VBA
Sub Example_IntersectWith()
    ' This example creates a line and circle and finds the points at
    ' which they intersect.
   
    ' Create the line
    Dim lineObj As AcadLine
    Dim startPt(0 To 2) As Double
    Dim endPt(0 To 2) As Double
    startPt(0) = 1: startPt(1) = 1: startPt(2) = 0
    endPt(0) = 5: endPt(1) = 5: endPt(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)
        
    ' Create the circle
    Dim circleObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 3: centerPt(1) = 3: centerPt(2) = 0
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)
    ZoomAll
      
    ' Find the intersection points between the line and the circle
    Dim intPoints As Variant
    intPoints = lineObj.IntersectWith(circleObj, acExtendNone)
   
    ' Print all the intersection points
    Dim I As Integer, j As Integer, k As Integer
    Dim str As String
    If VarType(intPoints)  vbEmpty Then
        For I = LBound(intPoints) To UBound(intPoints)
            str = "Intersection Point[" & k & "] is: " & intPoints(j) & "," & intPoints(j + 1) & "," & intPoints(j + 2)
            MsgBox str, , "IntersectWith Example"
            str = ""
            I = I + 2
            j = j + 3
            k = k + 1
        Next
    End If
End Sub
回复

使用道具 举报

15

主题

127

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
187
发表于 2006-6-11 14:03:00 | 显示全部楼层
IntersectWith命令稳定性很不好!
回复

使用道具 举报

1

主题

17

帖子

1

银币

初来乍到

Rank: 1

铜币
21
发表于 2006-6-18 15:36:00 | 显示全部楼层
是不好用,不知道它找到交点是怎么排序的!!!一个交点无所谓,交点多了,就麻烦了
回复

使用道具 举报

7

主题

51

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
79
发表于 2006-6-18 21:30:00 | 显示全部楼层
按基线的走向排序
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-5 20:17 , Processed in 0.360301 second(s), 73 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表