乐筑天下

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

如何获取CAD多段线各顶点坐标

[复制链接]

2

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
11
发表于 2007-10-28 18:00:00 | 显示全部楼层 |阅读模式
如何获取CAD各顶点坐标呢?
本人一直在试,一直未获成功,心情异常沉重,肯请各位老兄给予指点!!
回复

使用道具 举报

1

主题

28

帖子

4

银币

初来乍到

Rank: 1

铜币
32
发表于 2008-3-19 09:17:00 | 显示全部楼层
论坛上有这个方面的资料,建议查询一下
回复

使用道具 举报

16

主题

93

帖子

5

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
157
发表于 2008-3-19 20:52:00 | 显示全部楼层

给你个可输出polygon多段线节点的小程序(适用于AutoCAD 2004)
polygon多段线节点输出.rar
回复

使用道具 举报

9

主题

33

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2008-3-20 14:25:00 | 显示全部楼层
语法
object.Coordinate(index)
object
, , , , , , ,
使用该属性的对象。
Coordinate
Variant[变体] (三元素或两元素双精度数组); 可读写
指定顶点的 X、 Y 和 Z 坐标的数组。
LightweightPolyline 对象:变体为两元素,它表示 OCS 坐标系统下的 X 和 Y 坐标。
Polyline 对象:: 变体为三元素,它表示 OCS 坐标系统下的 X 和 Y 坐标。而 Z 坐标在变体中有预留但被忽略。
所有其它对象:变体为三元素,它表示 WCS 坐标系统下的 X 和 Y 坐标;而 Z 坐标在活动 UCS 上默认为 0。
Index
Integer[整数]
在顶点数组中你所要设置或查询的顶点的索引号。顶点数组的基数为 0。
说明
该属性将替换指定对象任何存在的顶点。使用标准的数组处理技术来处理包含在该属性中的值。
3DPolyline, Polyline, PolygonMesh: 对于简单的多段线 (非样条化或曲线拟合),该属性指的是一般的顶点。对于样条化或曲线拟合的多段线,该属性指的是控制点顶点。
Polyline 和 LightweightPolyline 对象的 OCS 坐标可以使用  方法与其它坐标系统进行转换。
       
©2000-2006 版权所有 不得复制传播  
该拷贝仅用于乐筑天下网站在线服务使用,如需要购买,请联系本站管理员:mccad,邮件地址:
Sub Example_Coordinate()
    ' This example creates a polyline in model space and
    ' queries and changes the coordinate in the first index position.
        
    Dim plineObj As AcadPolyline
    Dim points(0 To 14) As Double
   
    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
        
    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ZoomAll
   
    ' Find the coordinate in the first index position
    Dim coord As Variant
    coord = plineObj.Coordinate(0)
    MsgBox "The coordinate in the first index position of the polyline is: " & coord(0) & ", " _
        & coord(1) & ", " & coord(2)
   
    ' Change the coordinate
    coord(0) = coord(0) + 1
    plineObj.Coordinate(0) = coord
    plineObj.Update
   
    ' Query the new coordinate
    coord = plineObj.Coordinate(0)
    MsgBox "The coordinate in the first index position of the polyline is now: " & coord(0) & ", " _
        & coord(1) & ", " & coord(2)
   
End Sub
回复

使用道具 举报

9

主题

33

帖子

2

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2008-3-20 14:27:00 | 显示全部楼层
乐筑天下中文通道里搜Coordinate
回复

使用道具 举报

0

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
2
发表于 2010-4-29 19:55:00 | 显示全部楼层
谢谢啊
回复

使用道具 举报

120

主题

326

帖子

7

银币

中流砥柱

Rank: 25

铜币
806
发表于 2010-5-1 16:56:00 | 显示全部楼层
一定要注意这两种多段线的定义.
  Dim pl As AcadPolyline
  Dim ppl As AcadLWPolyline

回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
1
发表于 2010-7-6 12:36:00 | 显示全部楼层
谢谢哈!
回复

使用道具 举报

5

主题

27

帖子

7

银币

初来乍到

Rank: 1

铜币
47
发表于 2010-8-30 08:08:00 | 显示全部楼层
这个有实用价值。下来学习了。
回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
1
发表于 2010-9-19 17:34:00 | 显示全部楼层
多谢了,正需要这样的东西。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-1 09:03 , Processed in 0.412643 second(s), 73 queries .

© 2020-2025 乐筑天下

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