xtjtg 发表于 2008-11-22 18:58:00

恳请高手帮忙啊都快疯了。AddSpline怎用使用Closed 属性

<p>真的,帮帮忙!在线等!都研究了两天了,发疯了!</p><p>如题,AddSpline怎用使用Closed 属性?</p><p>例:Private Sub Command12_Click()<br/>'非有理B样条<br/>&nbsp;&nbsp;&nbsp; Dim VetPoints(0 To 8) As Double<br/>&nbsp;&nbsp;&nbsp; Dim anObj As AcadSpline<br/>&nbsp;&nbsp;&nbsp; Dim Stan(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; Dim Etan(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; VetPoints(0) = 16: VetPoints(1) = 90: VetPoints(2) = 0: VetPoints(3) = 48: VetPoints(4) = 120<br/>&nbsp;&nbsp;&nbsp; VetPoints(5) = 0: VetPoints(6) = 100: VetPoints(7) = 70: VetPoints(8) = 0<br/>&nbsp;&nbsp;&nbsp; Stan(0) = 2: Stan(1) = 8: Stan(2) = 0<br/>&nbsp;&nbsp;&nbsp; Etan(0) = 3: Etan(1) = 1: Etan(2) = 0<br/>&nbsp;&nbsp;&nbsp; Set anObj = MoSpace.AddSpline(VetPoints, Stan, Etan)<br/>&nbsp;&nbsp;&nbsp; anObj.Update<br/>&nbsp;&nbsp;&nbsp; ZoomAll<br/>End Sub<br/></p><p>为什么不能直接使用“anobj.closed=true”,系统会提示说“不能给只读属性赋值”</p><p>而下面这个例子:</p><p>Private Sub Command11_Click()<br/>'创建多段线<br/>&nbsp;&nbsp;&nbsp; Dim plineObj1 As AcadPolyline<br/>&nbsp;&nbsp;&nbsp; Dim points(0 To 11) As Double<br/>&nbsp;&nbsp;&nbsp; points(0) = 10: points(1) = 65: points(2) = 0<br/>&nbsp;&nbsp;&nbsp; points(3) = 10: points(4) = 80:<br/>&nbsp;&nbsp;&nbsp; points(6) = 30: points(7) = 80:<br/>&nbsp;&nbsp;&nbsp; points(9) = 45: points(10) = 80:<br/>&nbsp;&nbsp;&nbsp; Set plineObj1 = AcadDoc.ModelSpace.AddPolyline(points)<br/>&nbsp;&nbsp;&nbsp; plineObj.Closed = True</p><p>end sub</p><p>就可以直接使用“plineObj.Closed = True”,就能闭合。</p><p>为什么呢?会的大侠,麻烦帮个忙,不甚感激!</p><p></p>

sailorcwx 发表于 2008-11-22 23:54:00

<p class="element">Closed:read-only for spline objects; read-write for all others <br/>You can close the spline so the start point and endpoint are coincident and tangent. </p><p></p>

woaishuijia 发表于 2008-11-23 08:49:00

首尾相连自然就闭合了

xtjtg 发表于 2008-11-23 22:33:00

<p>谢谢二楼的。为什么偏偏是spline的closed属性是可读的呢?真是的!那参考书里还说,用close属性,这不是害人的吗?</p>
页: [1]
查看完整版本: 恳请高手帮忙啊都快疯了。AddSpline怎用使用Closed 属性