明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1413|回复: 2

请大虾帮忙解释一句代码

[复制链接]
发表于 2007-4-19 14:48:00 | 显示全部楼层 |阅读模式

ThisDrawing.SendCommand "_-Boundary" & vbCr & InsP(0) & "," & InsP(1) & vbCr & vbCr

boundary具体用法!网上找了很久,没有找到

发表于 2007-4-20 06:24:00 | 显示全部楼层

有点晕,boundary是AutoCAD的命令,你在命令行中试试。

发表于 2007-4-20 09:11:00 | 显示全部楼层

' 单击一点生成闭合多段线
Public Sub ClickAddPolyline()
    ' 获得当前的实体数量
    Dim n As Long
    n = ThisDrawing.ModelSpace.Count
   
    ' 提示用户拾取一点
    Dim pt As Variant
    pt = ThisDrawing.Utility.GetPoint(, "指定内部点: ")
   
    ' 创建多段线
    ThisDrawing.SendCommand "-Boundary" & vbCr & pt(0) & "," & pt(1) & vbCr & vbCr
   
    ' 将生成的多段线颜色变为红色
    Dim objPoly As AcadLWPolyline
    If ThisDrawing.ModelSpace.Count > n Then
        Set objPoly = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
        objPoly.color = acRed
    Else
        MsgBox "未发现有效的边界。"
    End If
End Sub

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

本版积分规则

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

GMT+8, 2025-2-22 18:28 , Processed in 0.152240 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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