chenting 发表于 2006-6-8 20:43:00

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

能详细讲一下吗?谢谢了

xinghesnak 发表于 2006-6-9 14:00:00

<P>
<TABLE class=TitleTable cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD><A title="Click to go Back" style="TEXT-DECORATION: none" href="<b>javascript</b> :history.back();" target="_blank" >
<P class=Heading-1>IntersectWith Example </P></A></TD></TR></TBODY></TABLE></P>
<P class=TitleSpacing>
<P class=h1-access>
<OBJECT id=alink_using_other_programming_languages type=application/x-oleobject classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><PARAM NAME="Width" VALUE="0"><PARAM NAME="Height" VALUE="0"><PARAM NAME="Command" VALUE="ALink"><PARAM NAME="Item1" VALUE="acad_aag.chm"><PARAM NAME="Item2" VALUE="using_other_programming_languages"></OBJECT>Using Programming Languages other than VBA</P><PRE class=Code>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) &lt;&gt; vbEmpty Then
      For I = LBound(intPoints) To UBound(intPoints)
            str = "Intersection Point[" &amp; k &amp; "] is: " &amp; intPoints(j) &amp; "," &amp; intPoints(j + 1) &amp; "," &amp; intPoints(j + 2)
            MsgBox str, , "IntersectWith Example"
            str = ""
            I = I + 2
            j = j + 3
            k = k + 1
      Next
    End If
End Sub</PRE>

zxj_76 发表于 2006-6-11 14:03:00

<STRONG>IntersectWith命令稳定性很不好!</STRONG>

peicong 发表于 2006-6-18 15:36:00

是不好用,不知道它找到交点是怎么排序的!!!一个交点无所谓,交点多了,就麻烦了

68651521 发表于 2006-6-18 21:30:00

<P>按基线的走向排序</P>
页: [1]
查看完整版本: 找不到什么书,只有求助大家了!IntersectWith怎么用啊?