乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 57|回复: 3

[求助]直线的起点和终点的获得

[复制链接]

6

主题

10

帖子

1

银币

初来乍到

Rank: 1

铜币
34
发表于 2005-3-31 12:47:00 | 显示全部楼层 |阅读模式
[U]请问 在vba[/U][U]进行二次开发时如何获得一条直线的起点和终点[/U]
回复

使用道具 举报

1

主题

7

帖子

1

银币

初来乍到

Rank: 1

铜币
11
发表于 2005-3-31 13:17:00 | 显示全部楼层
&ltRE class=Code>Sub Example_StartPoint()
    ' This example creates an elliptical arc and then
    ' finds the coordinates of its start point and endpoint.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    Dim startPoint As Variant
    Dim endPoint As Variant
   
    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
   
    ' Enter a start angle of 45 degrees, and an end angle of 270 degrees
    ellObj.startAngle = 45 * (3.14 / 180)
    ellObj.endAngle = 270 * (3.14 / 180)
    ZoomAll
   
    ' Find the start and endpoints for the ellipse
    startPoint = ellObj.startPoint
    endPoint = ellObj.endPoint
    MsgBox "This ellipse has a start point of " & startPoint(0) & ", " & startPoint(1) & ", " & startPoint(2) & " and an endpoint of " & endPoint(0) & ", " & endPoint(1) & ", " & endPoint(2), vbInformation, "StartPoint Example"
End Sub
回复

使用道具 举报

6

主题

10

帖子

1

银币

初来乍到

Rank: 1

铜币
34
发表于 2005-3-31 16:03:00 | 显示全部楼层
上面的程序好像不对         我说的是这条直线已存在         要获得起点坐标(x,y)的值
回复

使用道具 举报

1

主题

7

帖子

1

银币

初来乍到

Rank: 1

铜币
11
发表于 2005-3-31 19:59:00 | 显示全部楼层
startPoint = ellObj.startPoint
endPoint = ellObj.endPoint
就是这个属性
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-16 21:58 , Processed in 1.791306 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表