如何从Coordinates中提取各坐标点数据
get3Dpts = ent.Coordinates<br/> While get3Dpts(i) <> ""<br/> x(0) = get3Dpts(i): x(1) = get3Dpts(i + 1): x(2) = get3Dpts(i + 2)<br/> i = i + 3<br/> Set point = ThisDrawing.ModelSpace.AddPoint(x)<br/> Wend<br/>这里面get3Dpts(i) <> ""好像不能检验结束,不知如何是好!<br/>跪求各位老兄赐教!!小弟不胜感激!!!!!<br/> <p>也许问题在get3Dpts的数据类型</p><p>未赋值的get3Dpsts也许等于0而不是""</p><p>不知道对不对,你测试一下</p> 上面的老兄说得对,我也觉得问题应该就在get3Dpts上<br/>但把它改成 While get3Dpts(i) <> 0 后,依然不对<br/>提示下标越界,即get3Dpts中的数据提完后,get3Dpts(i)就变得下标越界了。<br/>实在不知如何提出上面的 Coordinates 中的坐标。<br/>或是哪位老兄知道更简单的办法自动提取3D线上的坐标来<br/>跪求各位老兄赐教!!小弟不胜感激!!!!!<br/> <p>用Ubound(get3Dpts)可以得到get3Dpts数组的个数,然后用For循环就简单多了。</p> <p>管板交点</p><p>Sub Example_IntersectWith()<br/> ' This example creates a line and circle and finds the points at<br/> ' which they intersect.<br/> Dim Object As AcadEntity, Object1 As AcadEntity<br/> Dim ii As Integer<br/> Dim ppt As Variant<br/> For ii = 0 To ThisDrawing.ModelSpace.Count - 1<br/> On Error Resume Next<br/> Set Object = ThisDrawing.ModelSpace.Item(ii)<br/> If ii = ThisDrawing.ModelSpace.Count - 1 Then<br/> Set Object1 = ThisDrawing.ModelSpace.Item(0)<br/> Else<br/> Set Object1 = ThisDrawing.ModelSpace.Item(ii + 1)<br/> End If<br/> 'Debug.Print Object.Handle, Object1.Handle<br/> ppt = Object1.IntersectWith(Object, acExtendBoth)<br/> Debug.Print ii, ppt(0), ppt(1), ppt(2)<br/> <br/> <br/> Next ii<br/>End Sub</p>
页:
[1]