加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

CASS改变线型

(2008-08-17 11:39:00)
标签:

it

分类: 工作/开发方面

Signature

  object.Linetype

  object

  All Drawing objects, AttributeReference, Group, Layer
  The object this property applies to.

  Linetype

  String; read-write (write-only for the Group object)'仅对Group object可写
  The linetype of an object. The default linetype is the linetype of the layer (BYLAYER).

 

所以:要改变一个对象的线型,必须把它放入到一个Group中。

 

例子如下:

Sub Example_Linetype()
    ' This example searches for the linetype DashDot. If it is
    ' not found, it is added from the acad.lin file. Then a
    ' line is created and changed to the DashDot linetype.
   
    ' Search the linetypes collection for the DashDot linetype.
    Dim entry As AcadLineType
    Dim found As Boolean
    found = False
    For Each entry In ThisDrawing.Linetypes
        If StrComp(entry.Name, "DASHDOT", 1) = 0 Then
            found = True
            Exit For
        End If
    Next
    If Not (found) Then ThisDrawing.Linetypes.Load "DASHDOT", "acad.lin"
       
    ' Create the line
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
   
    ' Change the linetype of the line
    Set groupObj = ThisDrawing.Groups.Add("TEST_GROUP")

    ReDim appendobjs(0) As AcadEntity
    Set appendobjs(0) = lineObj
    groupObj.AppendItems appendobjs

    groupObj.Linetype = "DASHDOT"

    ThisDrawing.Regen acActiveViewport

End Sub

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有