转载如下:
'加入扩展数据
Public Function AddXDATA() Dim returnObj As AcadObject ReDim xtype(0 To 1) As Integer ReDim xdata(0 To 1) As Variant Dim basePoint(0 To 2) As Double
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object" xtype(0) = 1001: xdata(0) = "AAA" xtype(1) = 1000: xdata(1) = "888" returnObj.SetXDATA xtype, xdata End Function
'建选择集
Public Function FindEntByXData() Dim tempsset1 As AcadSelectionSet Dim filterType1(1) As Integer Dim filterData1(1) As Variant filterType1(0) = 1001: filterData1(0) = "AAA" filterType1(1) = 1000: filterData1(1) = "888" Set tempsset1 = acadDoc.SelectionSets.Add("SSet") tempsset1.Clear tempsset1.Select acSelectionSetAll, , , filterType1, filterData1 tempsset1.Delete End Function
|