明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1060|回复: 2

新手求教!

[复制链接]
发表于 2004-11-10 10:16:00 | 显示全部楼层 |阅读模式
扩展数据是什么啊?可以给我举个例子吗?谢了!
发表于 2004-11-10 13:40:00 | 显示全部楼层
Sub setxRecord() Dim linext(0 To 4) As Integer
Dim linexd(0 To 4) As Variant
Dim sPoint(0 To 2) As Double
Dim ePoint(0 To 2) As Double
sPoint(0) = 10
sPoint(1) = 10
sPoint(2) = 0
ePoint(0) = 30
ePoint(1) = 30
ePoint(2) = 0
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.addline(sPoint, ePoint)
lineObj.Color = 1 linext(0) = 1001: linexd(0) = "LineInfo"
linext(1) = 1000: linexd(1) = "a"
linext(2) = 1000: linexd(2) = "b"
linext(3) = 1000: linexd(3) = "c"
linext(4) = 1000: linexd(4) = "d" ThisDrawing.RegisteredApplications.Add "LineInfo"
lineObj.SetXData linext, linexd
lineObj.Update End Sub Sub getxRecord()
Dim a As Variant
Dim b As Variant
Dim sset As AcadSelectionSet
Set sset = ThisDrawing.SelectionSets.Add("ss")
Dim point As Variant
point = ThisDrawing.Utility.GetPoint()
sset.SelectAtPoint point
Dim entry As AcadEntity
Dim xdataOut As Variant
Dim xtypeOut As Variant

For Each entry In sset
If StrComp(entry.ObjectName, "AcDbLine", 1) = 0 Then
entry.GetXData "", xtypeOut, xdataOut
MsgBox xdataOut(1) & "," & xdataout(2) & "," & xdataout(3) & "," & xdataout(4)
End If
Next
ThisDrawing.SelectionSets.Item("ss").Delete
End Sub
发表于 2004-11-10 13:43:00 | 显示全部楼层
XDATA,就是在图形上附加自己的数据,可以看看帮助中的示例。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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