- 积分
- 1074
- 明经币
- 个
- 注册时间
- 2004-4-3
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-12-30 21:12:00
|
显示全部楼层
<RE class=Code>这段代码从帮助文件上拷来的,以后多看看帮助文件就是了。本网站上还有中文版的。</PRE><RE class=Code>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
lineObj.Linetype = "DASHDOT"
ZoomAll
End Sub</PRE> |
|