乐筑天下

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

再次请教"谁有vba的返回多义线所点击子段的端点坐标程序"

[复制链接]

110

主题

324

帖子

10

银币

中流砥柱

Rank: 25

铜币
764
发表于 2005-12-4 15:57:00 | 显示全部楼层 |阅读模式
谁有vba的返回多义线所点击子段的端点坐标程序
斑竹的是vlisp的,
谁有vba的返回多义线所点击子段的端点坐标程序 ,共享学习以下,谢谢了
回复

使用道具 举报

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2005-12-4 18:32:00 | 显示全部楼层
多义线的Coordinates属性直接可以得到啊!
帮助中的例子-
Sub Example_Coordinates()
    ' This example creates a polyline. It then uses the Coordinates
    ' property to return all the coordinates  in the polyline. It then
    ' resets one of the vertices using the Coordinates property.
   
    Dim plineObj As AcadPolyline    ' Create Polyline
    Dim points(5) As Double
    points(0) = 3: points(1) = 7: points(2) = 0
    points(3) = 9: points(4) = 2: points(5) = 0
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ThisDrawing.Regen True    ' Return all the coordinates of the polyline
    Dim retCoord As Variant
    retCoord = plineObj.Coordinates    ' Display current coordinates for the first vertex
    MsgBox "The current coordinates of the second vertex are: " & points(3) & ", " & points(4) & ", " & points(5), vbInformation, "Coordinates Example"    ' Modify the coordinate of the second vertex to (5,5,0). Note that in
    ' case of a lightweight Polyline, indices will be different because the points are 2D only.
    points(3) = 5
    points(4) = 5
    points(5) = 0
    plineObj.Coordinates = points    ' Update display
    ThisDrawing.Regen True    MsgBox "The new coordinates have been set to " & points(3) & ", " & points(4) & ", " & points(5), vbInformation, "Coordinates Example"
End Sub
回复

使用道具 举报

110

主题

324

帖子

10

银币

中流砥柱

Rank: 25

铜币
764
发表于 2005-12-11 17:16:00 | 显示全部楼层
谢谢斑竹,我的意思是多段线的有多个"子段",使用鼠标点击其中的一个"子段",使用vba编程显示此"子段"的两对坐标
回复

使用道具 举报

13

主题

396

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
448
发表于 2005-12-12 15:35:00 | 显示全部楼层
关键是如何获得选中的子段,我是这样处理的:
1,炸开选中的多段线,获得子段集合
2,获得子段集合与选择点距离最近及选择点与子段两端点夹角最大的即是

回复

使用道具 举报

28

主题

71

帖子

4

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
183
发表于 2005-12-12 17:15:00 | 显示全部楼层
你可以用对象捕捉的方式捕捉到实体上的点,看它在哪两个点之间。在同一直线上的三个点必然有两个点距离之和等与另两个点的距离,要是不在一直线上呢,就是距离不等了啊
就这就可以判断出在哪两点之间。要再不懂的话我给你发段源代码
回复

使用道具 举报

110

主题

324

帖子

10

银币

中流砥柱

Rank: 25

铜币
764
发表于 2005-12-18 10:59:00 | 显示全部楼层
谢谢了,楼上的
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-5 00:22 , Processed in 0.944636 second(s), 64 queries .

© 2020-2025 乐筑天下

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