明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1414|回复: 3

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

[复制链接]
发表于 2008-11-22 18:58:00 | 显示全部楼层 |阅读模式

真的,帮帮忙!在线等!都研究了两天了,发疯了!

如题,AddSpline怎用使用Closed 属性?

例:Private Sub Command12_Click()
'非有理B样条
    Dim VetPoints(0 To 8) As Double
    Dim anObj As AcadSpline
    Dim Stan(0 To 2) As Double
    Dim Etan(0 To 2) As Double
    VetPoints(0) = 16: VetPoints(1) = 90: VetPoints(2) = 0: VetPoints(3) = 48: VetPoints(4) = 120
    VetPoints(5) = 0: VetPoints(6) = 100: VetPoints(7) = 70: VetPoints(8) = 0
    Stan(0) = 2: Stan(1) = 8: Stan(2) = 0
    Etan(0) = 3: Etan(1) = 1: Etan(2) = 0
    Set anObj = MoSpace.AddSpline(VetPoints, Stan, Etan)
    anObj.Update
    ZoomAll
End Sub

为什么不能直接使用“anobj.closed=true”,系统会提示说“不能给只读属性赋值”

而下面这个例子:

Private Sub Command11_Click()
'创建多段线
    Dim plineObj1 As AcadPolyline
    Dim points(0 To 11) As Double
    points(0) = 10: points(1) = 65: points(2) = 0
    points(3) = 10: points(4) = 80:
    points(6) = 30: points(7) = 80:
    points(9) = 45: points(10) = 80:
    Set plineObj1 = AcadDoc.ModelSpace.AddPolyline(points)
    plineObj.Closed = True

end sub

就可以直接使用“plineObj.Closed = True”,就能闭合。

为什么呢?会的大侠,麻烦帮个忙,不甚感激!

发表于 2008-11-22 23:54:00 | 显示全部楼层

Closed:read-only for spline objects; read-write for all others
You can close the spline so the start point and endpoint are coincident and tangent.

发表于 2008-11-23 08:49:00 | 显示全部楼层
首尾相连自然就闭合了
 楼主| 发表于 2008-11-23 22:33:00 | 显示全部楼层

谢谢二楼的。为什么偏偏是spline的closed属性是可读的呢?真是的!那参考书里还说,用close属性,这不是害人的吗?

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

本版积分规则

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

GMT+8, 2024-11-26 06:44 , Processed in 0.149506 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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