明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2248|回复: 4

VBA中画虚线函数的问题?

[复制链接]
发表于 2005-12-28 22:58:00 | 显示全部楼层 |阅读模式
请问大侠,VBA中连接两点用直线的函数为addline(a,b) 。那么连接两点用虚线的函数是什么呢?谢谢!
发表于 2005-12-29 11:57:00 | 显示全部楼层
虚线是用线形实现的吧!
 楼主| 发表于 2005-12-29 15:53:00 | 显示全部楼层

大侠,具体怎么弄呢?

发表于 2005-12-30 19:40:00 | 显示全部楼层
画好后,你再改变线型就可以了
发表于 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>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-27 08:23 , Processed in 0.180244 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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