Message 1 of 9
Select using XData Filter, only works with lwpolyline, is it a bug?

Not applicable
06-02-2002
08:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to select entities using XData, it's only working with polylines,
if the XData is attached to a different entity type, it won't work.
The following code will attach XData to any entity
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
This code will only work if the above code was applied to a polyline
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
Your help will be deeply appreciated
Best regards
Wael Bakr
I'm trying to select entities using XData, it's only working with polylines,
if the XData is attached to a different entity type, it won't work.
The following code will attach XData to any entity
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
This code will only work if the above code was applied to a polyline
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
Your help will be deeply appreciated
Best regards
Wael Bakr