[讨论]扩展数据的使用
扩展数据可以存贮对象的属性数据,可以扩展CAD的属性数据管理功能。如何用扩展数据查找对象?如何创建、修改、删除扩展数据?如何查询对象的扩展数据? 用扩展数据查找对象设置过滤器只能是1001组码
创建、修改、删除扩展数据用的都是SetXData方法
查询对象的扩展数据用GetXData方法 斑竹给个1001组码过滤的例子~~~~~~ <FONT face=宋体 size=2>Public Sub Test()<BR>On Error Resume Next<BR>Dim pnt(2) As Double, dot(2) As Double<BR>Dim xt(3) As Integer, xd(3) As Variant<BR>Dim ft(0) As Integer, fd(0) As Variant<BR>Dim ss As AcadSelectionSet<BR>Dim obj As AcadLine<BR>Set obj = ThisDrawing.ModelSpace.AddLine(pnt, dot)<BR>xt(0) = 1001: xd(0) = "Test"<BR>xt(1) = 1002: xd(1) = "{"<BR>xt(2) = 1001: xd(2) = "Test1"<BR>xt(3) = 1002: xd(3) = "}"<BR>ThisDrawing.RegisteredApplications.Add "Test1"<BR>obj.SetXData xt, xd<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>ss.Clear<BR>ft(0) = 1001: fd(0) = "Test1"<BR>ss.Select acSelectionSetAll, , , ft, fd<BR>MsgBox ss.Count<BR>End Sub</FONT> 谢了斑竹,献花一朵~~~~~ <p>为什么我这样写也可以呀,你多的哪些是干啥用的?</p><p>Public Sub Test()</p><p>Dim pnt(2) As Double, dot(2) As Double</p><p>Dim xt(1) As Integer, xd(1) As Integer</p><p>Dim obj As AcadLine</p><p>dot(0)=1:dot(1)=1</p><p>Set obj = ThisDrawing.ModelSpace.AddLine(pnt, dot)<br/>xt(0) = 1001: xd(0) = "test"<br/>xt(1) = 1070: xd(1) = 6002<br/>obj.SetXData xt, xd</p><p>End sub<br/></p> <p>交流学校中</p> 雪山飞狐_lzh 发表于 2004-6-17 10:27 static/image/common/back.gif
Public Sub Test()On Error Resume NextDim pnt(2) As Double, dot(2) As DoubleDim xt(3) As Integer, xd( ...
飞狐,您好,如果要给一条直线增加一个属性,属性名为“频率”,大小默认为100,可以修改大小,请问用 C#该如何实现啊,我是用vs2008+CAD2010,非常感谢!
页:
[1]